Skip to content

Notification Package

packages/notification contains the shared client used when the API or auth layer needs to call an external notification service.

  • NotificationClient
  • notification request and response types
  • createAuthHeaders() for signed provider requests

The API reads these optional values from the root environment:

VariablePurpose
NOTIFICATION_SERVICE_ENDPOINTProvider endpoint used for outbound notification requests
NOTIFICATION_SERVICE_KEY_IDKey identifier sent with signed requests
NOTIFICATION_SERVICE_SECRETShared secret used to sign provider requests
SMS_TEMPLATE_IDProvider template id for SMS OTP delivery

If notification settings are absent, auth can still run locally with test OTP behavior when CREATE_TEST_OTP=true.

The auth package receives notification config from the API runtime and uses it for OTP delivery hooks. The package keeps provider-specific signing and transport details out of the route handlers.

Use this package when a shared service needs to send a notification through the configured provider instead of making ad hoc fetch() calls.