Token Types
Retailer JWT
Retailer JWT
Algorithm: HS256
Secret:
Stored in cookies via
RETAILER_JWT_PRIVATE_KEY
Guard: RetailerAuthGuardClaims:| Claim | Description |
|---|---|
sub | Retailer ID |
aud | ['retailer'] |
RETAILER_ACCESS_TOKEN_COOKIE_NAME.Admin JWT
Admin JWT
Algorithm: HS256
Secret:
Admin tokens can impersonate retailers via the
ADMIN_JWT_PRIVATE_KEY
Guard: AdminAuthGuardClaims:| Claim | Description |
|---|---|
fullAccess | Admin privileges flag |
aud | ['retailer'] |
act.sub | Impersonated retailer ID (optional) |
act.sub claim.Reactivate Token
Reactivate Token
Guard:
ReactivateAuthGuardUsed for all Reactivate module endpoints. The Reactivate module also has its own API key guard (ReactivateApiKeyGuard) for marketing endpoints.Bridge Token
Bridge Token
Secret:
BRIDGE_JWT_PRIVATE_KEYUsed for cross-service authentication. Exchanged for access/refresh tokens via POST /auth/bridge.Portal JWT
Portal JWT
Secret:
PORTAL_JWT_PRIVATE_KEY
Guard: PortalAuthGuardUsed for merchant portal SSO authentication.API Key Authentication
For service-to-service and reporting API access:- Guard:
ApiKeyAuthGuard - API keys are stored as
ApiKeyentities linked to aRetailer - Used by the Reporting API and external integrations
ReactivateApiKeyGuard) for marketing endpoints.
OAuth Integrations
| Provider | Service | Purpose |
|---|---|---|
| Shopify | ShopifyOAuthService | App installation and merchant auth |
| BigCommerce | Custom OAuth flow | App installation and merchant auth |
| Microsoft | MSALModule | Outlook/Office365 email account linking |
GoogleOauthService | Google email account linking |
Password Authentication
- Algorithm: bcryptjs
- Use Case:
UserRegistersWithPasswordUseCase
Multi-Factor Authentication
- OTP via email - One-time passwords sent to customer email
- Magic links - Auto-generated authentication links for admin access
Auth Flow Diagram
Token Refresh
Tokens are refreshed viaPOST /auth/refresh. The refresh flow validates the existing token and issues a new access token with an updated expiry.