Install the WorkOS Node.js SDK to start integrating enterprise authentication and user management features into your application.
Requirements
Node.js 20.15.0 or higher is required to use this SDK.
The SDK works across multiple JavaScript runtimes:
- Node.js (20.15.0+)
- Bun
- Deno
- Cloudflare Workers
- Vercel Edge Functions
- Other edge runtimes
Install the package
Choose your preferred package manager:
npm install @workos-inc/node
Verify installation
After installation, verify the SDK is working by importing it:
import { WorkOS } from '@workos-inc/node';
console.log('WorkOS SDK installed successfully!');
Runtime-specific imports
The SDK automatically detects your runtime and uses the appropriate build. However, you can also use runtime-specific imports if needed:
Node.js
Edge Runtime
Deno
Bun
// CommonJS
const { WorkOS } = require('@workos-inc/node');
// ES Modules
import { WorkOS } from '@workos-inc/node';
// Cloudflare Workers, Vercel Edge
import { WorkOS } from '@workos-inc/node/worker';
import { WorkOS } from 'npm:@workos-inc/node';
import { WorkOS } from '@workos-inc/node';
Beta releases
WorkOS occasionally releases beta versions with new features. To install a beta version:
npm install @workos-inc/node@beta
Beta versions may contain breaking changes between releases. We recommend pinning to a specific version:
Next steps
Configuration
Configure the WorkOS client with your API key
Quickstart
Build your first integration with WorkOS