Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7912256
Remove `dsync.deactivated` event (#1086)
kendallstrautman Feb 28, 2025
700df3b
upgrade minimum node-version to >= 18 (#1225)
nicknisi Feb 28, 2025
6d16117
Replace TSLint with ESLint (#1230)
nicknisi Mar 6, 2025
b397d42
Remove deprecated code for major version (#1224)
mattgd Mar 6, 2025
5517711
Remove deprecated Vault Secret references (#1249)
hexedpackets Mar 27, 2025
cb6e75b
Upgrade iron session version (#1251)
nicknisi Apr 1, 2025
079d731
Update to latest prettier (#1253)
nicknisi Apr 1, 2025
e274ebc
General dev dependency updates (#1254)
nicknisi Apr 1, 2025
ca2c096
Add tests and typing updates for pagination utils (#1252)
mattgd Apr 3, 2025
b25588f
Make userId or organizationId required when calling listOrganizationM…
mattgd Apr 3, 2025
415258f
[v8] Remove NodeCryptoProvider (#1270)
nicknisi May 13, 2025
16f9cf4
[v8] remove NodeHttpClient (#1271)
nicknisi May 16, 2025
73afbec
[v8] Add Node 24 to CI testing (#1278)
nicknisi May 19, 2025
5f61785
[v8] Add other runtime checks for environment variables (#1279)
nicknisi May 21, 2025
789edcd
[v8] Add ESM / CJS dual build (#1287)
nicknisi May 27, 2025
55b60cc
fix fga pagination
nicknisi Jun 11, 2025
1744051
v8.0.0-beta.1
nicknisi Jun 11, 2025
798cf59
formatting
nicknisi Jun 12, 2025
a6094b4
tsconfig fixes for build
nicknisi Jun 12, 2025
459bf33
v8.0.0-beta.2
nicknisi Jun 12, 2025
5357973
feat: Universal runtime compatibility for Node.js SDK v8 - fixes impo…
nicknisi Jul 11, 2025
653a857
Type constructEvent payload parameter as Record<string, unknown> (#1307)
mattgd Jul 11, 2025
0cba941
add @types/ws devDependency
nicknisi Jul 17, 2025
18bad96
[V8] remove direct process.env access, replacing with getEnv helper (…
nicknisi Jul 22, 2025
da33599
build fixes
nicknisi Aug 5, 2025
57b9aab
v8.0.0-beta.3
nicknisi Aug 5, 2025
6fdc34c
Remove Node version manager configs (v8)
chaance Aug 7, 2025
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: [18, 20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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: '18'
- 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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
node_modules
yarn-error.log
lib/
package-lock.json
.DS_Store
yarn.lock
yarn.lock
package-lock.json
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

4 changes: 2 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 18 or higher.

## Installation

Install the package with:

```
yarn add @workos-inc/node
npm install @workos-inc/node
```

## Configuration
Expand Down
62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import jestPlugin from 'eslint-plugin-jest';
import n from 'eslint-plugin-n';

const ignores = [
'**/*.snap',
'coverage',
'node_modules',
'dist',
'build',
'lib',
];

const tests = ['**/*.spec.{js,ts}'];

export default tseslint.config(
{
ignores,
},
{ linterOptions: { reportUnusedDisableDirectives: 'error' } },
eslint.configs.recommended,
tseslint.configs.recommended,
n.configs['flat/recommended'],
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-require-imports': 'off',
'n/no-missing-import': 'off',
'n/no-unsupported-features/node-builtins': 'off',
},
},
{
files: ['**/*.cjs'],
languageOptions: {
globals: {
require: 'readonly',
module: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
exports: 'readonly',
process: 'readonly',
},
},
},
{
files: tests,
extends: [jestPlugin.configs['flat/recommended']],
rules: {
'no-undef': 'off',
'jest/no-alias-methods': 'off',
'jest/no-identical-title': 'off',
'jest/no-disabled-tests': 'off',
'jest/no-conditional-expect': 'off',
'jest/valid-expect': 'off',
'jest/expect-expect': 'off',
},
},
);
10 changes: 10 additions & 0 deletions jest-transform-esm.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-env node */
const babelJest = require('babel-jest');

module.exports = babelJest.createTransformer({
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
plugins: ['@babel/plugin-transform-modules-commonjs'],
});
8 changes: 5 additions & 3 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
module.exports = {
clearMocks: true,
resetMocks: true,
Expand All @@ -9,8 +10,9 @@ module.exports = {
setupFilesAfterEnv: ['./setup-jest.ts'],
transform: {
'^.+\\.ts?$': 'ts-jest',
'^.+\\.m?js$': '<rootDir>/jest-transform-esm.cjs',
},
moduleNameMapper: {
'^jose': require.resolve('jose'),
},
transformIgnorePatterns: [
'node_modules/(?!(iron-session|uncrypto|cookie-es|@noble|@scure|jose)/)',
],
};
105 changes: 74 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.65.0",
"version": "8.0.0-beta.3",
"name": "@workos-inc/node",
"author": "WorkOS",
"description": "A Node wrapper for the WorkOS API",
Expand All @@ -9,15 +9,18 @@
"workos"
],
"volta": {
"node": "19.9.0",
"yarn": "1.22.19"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"typings": "lib/index.d.ts",
"type": "module",
"main": "./lib/cjs/index.cjs",
"module": "./lib/esm/index.js",
"types": "./lib/esm/index.d.ts",
"files": [
"lib/"
"lib/",
"package.json"
],
"repository": {
"type": "git",
Expand All @@ -28,50 +31,90 @@
},
"scripts": {
"clean": "rm -rf lib",
"build": "tsc -p .",
"lint": "tslint -p tsconfig.json -c tslint.json",
"build": "tsup",
"build:watch": "tsup --watch",
"lint": "eslint",
"test": "jest",
"test:watch": "jest --watch",
"test:worker": "jest src/worker.spec.ts",
"check:runtimes": "tsx scripts/ecosystem-check.ts",
"prettier": "prettier \"src/**/*.{js,ts,tsx}\" --check",
"format": "prettier \"src/**/*.{js,ts,tsx}\" --write",
"prepublishOnly": "yarn run build"
"prepublishOnly": "npm run build"
},
"dependencies": {
"iron-session": "~6.3.1",
"iron-session": "^8.0.4",
"jose": "~5.6.3",
"leb": "^1.0.0",
"pluralize": "8.0.0",
"qs": "6.14.0"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.5",
"@types/jest": "29.5.3",
"@types/node": "14.18.54",
"@types/pluralize": "0.0.30",
"jest": "29.6.2",
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@babel/preset-env": "^7.26.9",
"@babel/preset-typescript": "^7.27.0",
"@eslint/js": "^9.21.0",
"@types/cookie": "^0.6.0",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.14",
"@types/node": "~18",
"@types/pluralize": "0.0.33",
"@types/qs": "^6.14.0",
"@typescript-eslint/parser": "^8.25.0",
"babel-jest": "^29.7.0",
"esbuild-fix-imports-plugin": "^1.0.21",
"eslint": "^9.21.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-n": "^17.15.1",
"glob": "^11.0.3",
"jest": "29.7.0",
"jest-environment-miniflare": "^2.14.2",
"jest-fetch-mock": "^3.0.3",
"miniflare": "^3.20250408.2",
"nock": "^13.5.5",
"prettier": "2.8.8",
"supertest": "6.3.3",
"ts-jest": "29.1.3",
"tslint": "6.1.3",
"typescript": "5.1.6"
"prettier": "^3.5.3",
"supertest": "7.1.0",
"ts-jest": "29.3.1",
"tsup": "^8.5.0",
"tsx": "^4.19.0",
"typescript": "5.9.2",
"typescript-eslint": "^8.25.0"
},
"exports": {
"types": "./lib/index.d.ts",
"workerd": {
"import": "./lib/index.worker.js",
"default": "./lib/index.worker.js"
".": {
"types": {
"require": "./lib/cjs/index.d.cts",
"import": "./lib/esm/index.d.ts"
},
"workerd": {
"import": "./lib/esm/index.worker.js",
"require": "./lib/cjs/index.worker.cjs"
},
"edge-light": {
"import": "./lib/esm/index.worker.js",
"require": "./lib/cjs/index.worker.cjs"
},
"deno": "./lib/esm/index.js",
"bun": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.cjs"
},
"node": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.cjs"
},
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.cjs",
"default": "./lib/esm/index.js"
},
"edge-light": {
"import": "./lib/index.worker.js",
"default": "./lib/index.worker.js"
"./worker": {
"types": {
"require": "./lib/cjs/index.worker.d.cts",
"import": "./lib/esm/index.worker.d.ts"
},
"import": "./lib/esm/index.worker.js",
"require": "./lib/cjs/index.worker.cjs",
"default": "./lib/esm/index.worker.js"
},
"default": {
"import": "./lib/index.js",
"default": "./lib/index.js"
}
"./package.json": "./package.json"
}
}
Loading
Loading