nodejs service BETTERPORTAL v11.0.3

org.betterportal.auth.workos

betterportal/service-betterportal-auth-workos

BetterPortal WorkOS auth service

betterportal auth workos

BetterPortal WorkOS Auth Service

WorkOS AuthKit provider for BetterPortal. The service redirects users to WorkOS, exchanges the callback code server-side with the WorkOS Node SDK, issues BetterPortal tokens, and refreshes BP tokens from the WorkOS refresh token.

Per-app service config requires:

  • clientId
  • apiKey

Optional config:

  • provider defaults to authkit
  • connectionId, organizationId, domainHint
  • scopes
  • roleClaimPath defaults to roles
  • service config workosStatePath defaults to ./workos-state.json; set it to a persistent path such as /data/workos-state.json in production
  • service config syncIntervalSeconds defaults to 21600 and retries stale permission/role sync every 6 hours

Registry org: betterportal.

OAuth login states are stored as SHA-256 named pending files beside workosStatePath and atomically removed before a callback code is exchanged. Keep this directory writable. Replicas should share the same persistent path so callbacks can complete on any replica; a replica without the issued state rejects the callback. Expired pending files are cleaned during later login starts, and each replica limits its outstanding states to 10,000.

After-login and after-logout destinations are app-owned app.auth.redirects view references configured in Tenants & Apps, not provider addon fields.

Role sync keeps BP as the permission source of truth. WorkOS permission slugs are short service-owned keys, bp_<shortId>_<read|create|update|delete>, with the full tenant/service/view mapping stored in workosStatePath. Roles are mirrored per app from WorkOS role slugs into BP app roles.

The manifest advertises role-sync endpoints through the standard auth.roles.sync.view, auth.permissions.sync, and auth.roles.sync operation roles. Consumers discover their published paths instead of depending on WorkOS route names.

The service uses @workos-inc/node 11 on Node 24 (the SDK requires Node 22.11+). Its AuthKit, user/role/permission and SSO integrations retain their existing contracts; this service does not use the SDK's Pipes APIs changed in version 11.

To validate the SDK integration after updating the dependency:

npm run build -w @betterportal/auth-workos
npm run test -w @betterportal/auth-workos

Installation

Use as a dependency (client reference)
bsb client install betterportal/service-betterportal-auth-workos
Deploy as a service
bsb plugin install betterportal/service-betterportal-auth-workos
Node.js (npm)
npm install @betterportal/auth-workos

Configuration

Configuration options for this plugin:

No configuration required

Available Versions

v11.0.3 v11.0.2 v11.0.1 v11.0.0 v10.7.1 v10.7.0 v10.6.35 v10.6.34 v10.6.33 v10.6.32 v10.6.31 v10.6.30 v10.6.29 v10.6.28 v10.6.27 v10.6.26 v10.6.25 v10.6.24 v10.6.23 v10.6.22 v10.6.21 v10.6.20 v10.6.19 v10.6.18 v10.6.17 v10.6.16 v10.6.15 v10.6.14 v10.6.13 v10.6.12 v10.6.11 v10.6.10 v10.6.9 v10.6.7 v10.6.6 v10.6.3 v10.6.2 v10.6.1 v10.6.0 v10.5.0 v10.4.0 v10.3.0 v10.2.2 v10.2.1 v10.2.0 v10.1.70 v10.1.69 v10.1.68 v10.1.66 v10.1.65 v10.1.64 v10.1.63 v10.1.62 v10.1.61 v10.1.60 v10.1.59 v10.1.58 v10.1.57 v10.1.56 v10.1.55 v10.1.54 v10.1.53 v10.1.52 v10.1.51 v10.1.50 v10.1.49 v10.1.48 v10.1.47 v10.1.46 v10.1.45 v10.1.44 v10.1.43 v10.1.42 v10.1.41 v10.1.40 v10.1.39 v10.1.38 v10.1.37 v10.1.32 v10.1.31 v10.1.30 v10.1.29 v10.1.28 v10.1.27 v10.1.26 v10.1.25 v10.1.24 v10.1.23 v10.1.22 v10.1.21 v10.1.20 v10.1.19 v10.1.18 v10.1.17 v10.1.16 v10.1.15 v10.1.11 v10.1.10 v10.1.9 v10.1.8 v10.1.7 v10.1.6 v10.1.5 v10.1.4

Dependencies

No dependencies

Metadata