External Integrations

Overview of all third-party service integrations in the Renewa One backend. Each integration has a dedicated client or service, with credentials managed in Infisical EU (project renewa-one).

Integration Map

ServiceClient LocationPurposeDedicated Page
HubSpotbackend/src/services/hubspot/ (33 files)Bidirectional CRM syncHubSpot Integration
sevDeskbackend/src/services/sevdesk/Accounting / invoice bridge
DocuSignbackend/src/lib/docusign-client.tsE-signature in document flowsDocuSign
Azure Entrabackend/src/services/entra/SSO / identity provider, department + employee syncAzure Entra
Dataversebackend/src/lib/dataverse-client.tsMS Dynamics data importDataverse
Resendbackend/src/lib/email/Transactional emailResend Email
Bird (formerly MessageBird)backend/src/lib/sms/SMS messagingMessageBird SMS
Sentry@sentry/bun, captured in middleware/errorHandler.tsError trackingSentry
S3 / Tigrisbackend/src/lib/storage.ts (via FileService streams)Object file storage (CAS)Files
Upstash Redisbackend/src/lib/redis/Cache, BullMQ job queues, rate limitingBackground Jobs

Credential Management

All external credentials live in Infisical EU — never in code, config files, or GitHub Environment Secrets (GitHub holds CI-infra credentials only). Synced envs get them via Infisical → Fly native sync; see Secret Management Operations.

SecretServiceNotes
HUBSPOT_CLIENT_IDHubSpotPublic OAuth app ID
HUBSPOT_CLIENT_SECRETHubSpotWebhook signature validation (HMAC-SHA256 v3, 5-min window)
SEVDESK_API_TOKENsevDeskAccounting API access
ENCRYPTION_KEYInternalEncrypts OAuth tokens at rest (lib/encryption.ts)
SENTRY_DSN_BACKENDSentryError reporting endpoint
BIRD_API_KEYBirdSMS API access
TIGRIS_*Tigris/S3Object storage credentials
UPSTASH_REDIS_*UpstashRedis connection (REST + TCP)

Authentication Patterns

PatternUsed By
OAuth 2.0 (authorization code)HubSpot, DocuSign, Azure Entra
API key / tokenBird, Sentry, sevDesk, Resend
Access key + secretTigris/S3
Connection stringUpstash Redis

HubSpot and DocuSign OAuth tokens are stored encrypted in the database using ENCRYPTION_KEY (tokens auto-refresh 5 min before expiry). See Library Utilities for the encryption module.

HubSpot Integration Detail

The largest integration — 33 service files (as of 2026-06) under backend/src/services/hubspot/:

File / DirectoryResponsibility
auth.tsOAuth token management, automatic refresh
client.tsHubSpot API client
sync-engine/Config-driven sync engine; entity-configs.ts holds one EntitySyncConfig per object (canonical entity map)
event-handlers/Webhook event handlers incl. association-handler.ts
mapping/Property/enum mapping
webhook-handler.tsWebhook signature validation + dispatch
hubspot-sync.service.tsSync orchestration
hubspot-sync-admin.service.tsAdmin sync operations
full-sync.ts, owner-sync.tsFull re-sync, HubSpot owner sync
renewa-role-bindings.tsHubSpot internal_name → Renewa role bindings for associations
association-config.service.ts, handover-config.service.tsAssociation + handover config

Mirror mapping: HubSpot Deal = R1 projects (no deals table); Listing = buildings; Lead = hubspot_leads. HubSpot-tracked relationships use hubspot_associations + getAssociationsByRenewaName() instead of FK columns (spec 2026-05-08). See HubSpot Integration for full architecture.

Background Processing

Several integrations use Background Jobs (BullMQ + Redis, backend/src/lib/jobs/) for async processing:

Queue / ProcessorIntegration
NotificationsResend Email, MessageBird SMS
HubSpot sync queueHubSpot Integration
HubSpot webhook event queueHubSpot Integration
HubSpot association reconciliationHubSpot Integration
Entra sync (departments + employees, hourly)Azure Entra
Billing email + sevDesk payment syncsevDesk, Resend Email