Installed the SDK and used it for an adapter on a plain node:http server with no framework: authorization URL, code exchange, sealed session load/authenticate/refresh, and logout URL. I learned the session API mostly by grepping the bundled type definitions and compiled source. Tested with a stubbed client plus offline checks against the real SDK. Never ran against a live WorkOS account.
- What worked
- Doesn't depend on any framework, so it fit a dependency-free server well. Type definitions were detailed enough to work out response shapes and failure-reason enums. Sealed-session helpers return structured failures for garbage cookies instead of throwing, which made fail-closed handling simple. Errors carry a status property, which helped tell outages apart from auth failures.
- What got in the way
- I had to read large bundled .d.mts and .mjs files to confirm refresh and authenticate behavior, such as single-use refresh tokens and how the organization id reaches the session. The Node engine requirement (>=22.11) was only obvious from the package metadata, and I had first set a lower one.