Optional feature — WorkOS integration is optional. If you do not set it up, the default email+code login continues to work unchanged.
Prerequisites
- A WorkOS account with User Management enabled
- A running SuprSend self-hosted deployment
- Your dashboard URL (e.g.
https://app.yourdomain.com) and API URL (e.g.https://api.yourdomain.com)
Step 1 — Configure WorkOS dashboard
1.1 Create an application
In the WorkOS dashboard, create a new application (or use an existing one) and note down:| Value | Where to find it |
|---|---|
| Client ID | Dashboard → API Keys → Client ID |
| Secret Key | Dashboard → API Keys → Secret Key |
| AuthKit base URL | Dashboard → Authentication → AuthKit → your hosted domain (e.g. https://your-app.authkit.app) |
1.2 Add the redirect URI
Under Redirects, add your frontend sign-in callback page as an allowed redirect URI:app.yourdomain.com with your actual dashboard domain.
1.3 Register the webhook endpoint
Under Webhooks, add a new endpoint pointing at your SuprSend API:magic_auth.created— required for magic-link login emails
Step 2 — Add WorkOS secrets
Add the following keys to your existingsuprsend-secrets.yaml (inside stringData):
suprsend-secrets.yaml (additions)
Step 3 — Update suprsend-values.yaml
3.1 Backend (suprsend API)
Add the following under thesuprsendapi section:
suprsend-values.yaml (suprsendapi section)
3.2 Frontend (suprsend dashboard app)
The dashboard frontend usesviteDisableWorkosLoginFlow to toggle the login mode. Set it to "false" to enable WorkOS:
suprsend-values.yaml (suprsendApp section)
To switch back to the default email+code login at any time, set
viteDisableWorkosLoginFlow to "true" and re-run helm upgrade.Older guides sometimes used
viteEnableWorkosLoginFlow. Current Helm charts use viteDisableWorkosLoginFlow: set it to "false" to enable WorkOS (this is the inverse of the old flag).Step 4 — Apply changes
suprsendapi and suprsendApp pods to restart:
How the auth flow works
Login response typesresponse_type | Meaning | Frontend action |
|---|---|---|
LOGIN_SUCCESSFUL | User authenticated, membership active | Set auth state, redirect to dashboard |
MEMBERSHIP_DEACTIVATED | Membership exists but is inactive | Show deactivation message |
LINK_INVALID / LINK_EXPIRED | Code exchange failed | Show error with retry option |
Webhook integration
SuprSend registers a webhook endpoint at/v1/workos_webhook/ to receive events from WorkOS. For self-hosted deployments, the only required event is:
| Event | Purpose |
|---|---|
magic_auth.created | When a user requests a magic-link login, WorkOS fires this event. SuprSend receives it and sends the login code email directly via your configured SMTP. Without this webhook, magic-link login emails will not be delivered. |
- User requests a magic-link login via WorkOS AuthKit.
- WorkOS fires
magic_auth.createdtohttps://api.yourdomain.com/v1/workos_webhook/. - SuprSend verifies the webhook signature using
WORKOS_WEBHOOK_SECRET. - SuprSend fetches the magic-auth code from WorkOS and sends the login email via direct SMTP.
- Duplicate events are deduplicated using Redis (event IDs are cached for 3 days).
WorkOS AuthKit handles email verification natively — users must verify their email before they can authenticate. The
email_verification.created event is not required for self-hosted deployments.FAQ
Why does the dashboard still show email+code instead of WorkOS?
Why does the dashboard still show email+code instead of WorkOS?
Ensure
viteDisableWorkosLoginFlow is "false" or unset in suprsendApp.config (do not use the legacy viteEnableWorkosLoginFlow name — it is not in current charts). Run helm upgrade with your values file so the dashboard image is rebuilt with the updated setting; the frontend reads this flag at build time.Why do I see LINK_INVALID after returning from WorkOS?
Why do I see LINK_INVALID after returning from WorkOS?
- Check that the redirect URI in the WorkOS dashboard exactly matches your callback URL (e.g.
https://app.yourdomain.com/en/callback). - In
suprsendapi.config, confirmworkosClientIdandworkosSigninBaseUrlmatch the Client ID and AuthKit base URL from the WorkOS dashboard. - In your Kubernetes secret, confirm
workosApiKeymatches the Secret Key from WorkOS (API Keys). At runtime these appear asWORKOS_CLIENT_ID,WORKOS_API_KEY, etc. on the API deployment — verify the pods picked up the updated values afterhelm upgrade.
Why aren't magic-link login emails being delivered?
Why aren't magic-link login emails being delivered?
- Enable the
magic_auth.createdevent on the WorkOS webhook endpoint. - Ensure
WORKOS_WEBHOOK_SECRETin your Kubernetes secret matches the signing secret shown in the WorkOS webhook settings. - Confirm
https://api.yourdomain.com/v1/workos_webhook/is reachable from the public internet (WorkOS must be able to POST to it). - Verify SMTP is configured correctly — in self-hosted mode, SuprSend sends the login code email directly via your SMTP.