Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
14db482
Remove `dsync.deactivated` event (#1086)
kendallstrautman Feb 28, 2025
2574567
upgrade minimum node-version to >= 18 (#1225)
nicknisi Feb 28, 2025
521b072
Replace TSLint with ESLint (#1230)
nicknisi Mar 6, 2025
269fc93
Remove deprecated code for major version (#1224)
mattgd Mar 6, 2025
27b5ce0
Remove deprecated Vault Secret references (#1249)
hexedpackets Mar 27, 2025
c6d2f96
Upgrade iron session version (#1251)
nicknisi Apr 1, 2025
191d790
Update to latest prettier (#1253)
nicknisi Apr 1, 2025
49a4fda
General dev dependency updates (#1254)
nicknisi Apr 1, 2025
43c73f4
Add tests and typing updates for pagination utils (#1252)
mattgd Apr 3, 2025
94e92ea
Make userId or organizationId required when calling listOrganizationM…
mattgd Apr 3, 2025
90d9a55
[v8] Remove NodeCryptoProvider (#1270)
nicknisi May 13, 2025
b4f6cbd
[v8] remove NodeHttpClient (#1271)
nicknisi May 16, 2025
d409ada
[v8] Add Node 24 to CI testing (#1278)
nicknisi May 19, 2025
821ec08
[v8] Add other runtime checks for environment variables (#1279)
nicknisi May 21, 2025
09cab67
[v8] Add ESM / CJS dual build (#1287)
nicknisi May 27, 2025
dc5b3ac
fix fga pagination
nicknisi Jun 11, 2025
0da4e2a
v8.0.0-beta.1
nicknisi Jun 11, 2025
2a3564e
formatting
nicknisi Jun 12, 2025
78db872
tsconfig fixes for build
nicknisi Jun 12, 2025
6072e5c
v8.0.0-beta.2
nicknisi Jun 12, 2025
c7d3acc
feat: Universal runtime compatibility for Node.js SDK v8 - fixes impo…
nicknisi Jul 11, 2025
e6c7b54
Type constructEvent payload parameter as Record<string, unknown> (#1307)
mattgd Jul 11, 2025
314f4fa
add @types/ws devDependency
nicknisi Jul 17, 2025
da4de63
[V8] remove direct process.env access, replacing with getEnv helper (…
nicknisi Jul 22, 2025
711677f
build fixes
nicknisi Aug 5, 2025
df3134a
v8.0.0-beta.3
nicknisi Aug 5, 2025
aa61af7
formatting
nicknisi Aug 19, 2025
91e1ddc
test fixes
nicknisi Aug 19, 2025
c9366ae
[V8] create client API for methods that don't require an API key (#1354)
nicknisi Sep 23, 2025
467d2c2
don't ignore package-lock.json
nicknisi Sep 23, 2025
4286691
v8.0.0-beta.4
nicknisi Oct 2, 2025
1f1e638
Remove deprecated properties for v8 (#1365)
nicknisi Oct 7, 2025
831ca94
[v8] drop node 18 (#1366)
nicknisi Oct 8, 2025
11a6118
[v8] Update Dependencies (#1368)
nicknisi Oct 10, 2025
db02d23
Default PaginationOptions on AutoPaginatable (#1369)
nicknisi Oct 13, 2025
1ca9ef0
[v8] Add runtime analytics to User-Agent string (#1293)
nicknisi Oct 15, 2025
857e219
8.0.0-rc.1
nicknisi Oct 15, 2025
79f1aa4
[v8] Add dynamic import wrapper for jose to support Node.js 20.15-20.…
nicknisi Oct 28, 2025
7bddee6
v8.0.0-rc.2
nicknisi Oct 29, 2025
6e4b5ce
[v8] Replace leb and qs deps with vanilla implementations (#1382)
nicknisi Nov 6, 2025
2e1cdf7
v8.0.0-rc.3
nicknisi Nov 6, 2025
d042b86
Update convex import paths in package.json (#1386)
juliusmarminge Nov 17, 2025
8c82a0a
formatting
nicknisi Nov 24, 2025
5a8369b
[v8] Use globalThis.crypto.randomUUID for runtime-agnostic UUIDs (#1398)
nicknisi Nov 24, 2025
19452d4
[v8] Improve performance of audit log tests (#1408)
nicknisi Dec 2, 2025
6390571
[v8] fix: migrate from tsup to tsdown for faster, lower-memory builds…
nicknisi Dec 4, 2025
afb82ba
v8.0.0-rc.4 (#1412)
nicknisi Dec 4, 2025
b6c1cbd
[v8] Replace iron-session with iron-webcrypto v2 (#1416)
nicknisi Dec 15, 2025
70d600a
v8.0.0-rc.5
nicknisi Dec 15, 2025
ed37699
8.0.0-rc.6 (#1419)
nicknisi Dec 16, 2025
ebd376e
[v8] fix: bundle ESM-only deps for CJS compatibility (#1423)
nicknisi Dec 22, 2025
4db8a31
v8.0.0-rc.7
nicknisi Dec 22, 2025
1019637
[v8] feat: add PKCE support for public clients; remove /client entry …
nicknisi Jan 7, 2026
bdffdf7
chore: formatting cleanup and dependency pruning [v8] (#1439)
nicknisi Jan 8, 2026
ec697a3
feat: add createWorkOS factory for type-safe public/confidential clie…
nicknisi Jan 8, 2026
1416120
v8.0.0-rc.8
nicknisi Jan 8, 2026
234b259
add authenticateWithCode as a public method
nicknisi Jan 8, 2026
2457c07
v8.0.0-rc.9
nicknisi Jan 8, 2026
0c80832
fix: split ESM/CJS builds to fix Electron bundling issue (#1441)
nicknisi Jan 9, 2026
b97df3e
v8.0.0-rc.10
nicknisi Jan 9, 2026
e24c013
add migration guide
nicknisi Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18, 20, 22]
node: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fix-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
run: |
npm install

- name: Build Project
run: |
npm run build

- name: Run Tests
run: |
npm run test
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/runtime-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Runtime Compatibility Tests

on: [push, pull_request]

jobs:
runtime-compatibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: denoland/setup-deno@v2
with:
deno-version: v1.x
- uses: oven-sh/setup-bun@v2

- name: Install and build
run: |
npm install
npm run build

- name: Runtime compatibility check
run: npm run check:runtimes
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ yarn-error.log
lib/
.DS_Store
yarn.lock
.idea/
.idea/
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ See the [API Reference](https://workos.com/docs/reference/client-libraries) for

## Requirements

Node 16 or higher.
Node 20 or higher.

## Installation

Install the package with:

```
npm i @workos-inc/node
npm install @workos-inc/node
```

## Configuration
Expand All @@ -37,6 +37,60 @@ import { WorkOS } from '@workos-inc/node';
const workos = new WorkOS('sk_1234');
```

## Public Client Mode (Browser/Mobile/CLI)

For apps that can't securely store secrets, initialize with just a client ID:

```ts
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS({ clientId: 'client_...' }); // No API key needed

// Generate auth URL with automatic PKCE
const { url, codeVerifier } =
await workos.userManagement.getAuthorizationUrlWithPKCE({
provider: 'authkit',
redirectUri: 'myapp://callback',
clientId: 'client_...',
});

// After user authenticates, exchange code for tokens
const { accessToken, refreshToken } =
await workos.userManagement.authenticateWithCode({
code: authorizationCode,
codeVerifier,
clientId: 'client_...',
});
```

> [!IMPORTANT]
> Store `codeVerifier` securely on-device between generating the auth URL and handling the callback. For mobile apps, use platform secure storage (iOS Keychain, Android Keystore). For CLI apps, consider OS credential storage. The verifier must survive app restarts during the auth flow.

See the [AuthKit documentation](https://workos.com/docs/authkit) for details on PKCE authentication.

### PKCE with Confidential Clients

Server-side apps can also use PKCE alongside the client secret for defense in depth (recommended by OAuth 2.1):

```ts
const workos = new WorkOS('sk_...'); // With API key

// Use PKCE even with API key for additional security
const { url, codeVerifier } =
await workos.userManagement.getAuthorizationUrlWithPKCE({
provider: 'authkit',
redirectUri: 'https://example.com/callback',
clientId: 'client_...',
});

// Both client_secret AND code_verifier will be sent
const { accessToken } = await workos.userManagement.authenticateWithCode({
code: authorizationCode,
codeVerifier,
clientId: 'client_...',
});
```

## SDK Versioning

For our SDKs WorkOS follows a Semantic Versioning ([SemVer](https://semver.org/)) process where all releases will have a version X.Y.Z (like 1.0.0) pattern wherein Z would be a bug fix (e.g., 1.0.1), Y would be a minor release (1.1.0) and X would be a major release (2.0.0). We permit any breaking changes to only be released in major versions and strongly recommend reading changelogs before making any major version upgrades.
Expand Down
Loading