{"_id":"@caleblawson/auth-workos","name":"@caleblawson/auth-workos","dist-tags":{"latest":"0.10.1"},"versions":{"0.10.1":{"name":"@caleblawson/auth-workos","version":"0.10.1","description":"Mastra WorkOS Auth integration","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"license":"Elastic-2.0","dependencies":{"@workos-inc/node":"^7.54.0","@mastra/auth":"npm:@caleblawson/auth@0.1.0"},"devDependencies":{"@types/node":"^20.19.0","eslint":"^9.28.0","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^2.1.9","@internal/lint":"0.0.13","@mastra/core":"npm:@caleblawson/core@0.10.7-alpha.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake","build:watch":"pnpm build --watch","test":"vitest run","lint":"eslint ."},"gitHead":"c31e90130a5c9765c23f688ecea70adc6164543d","_id":"@caleblawson/auth-workos@0.10.1","_integrity":"sha512-yrdP/txWTH2uxrelVcEkgppzyD0/6pg6WlZ/Mev9khKoZfZOaPrjg8ofaOzSbPy7KLa5djdZxgU+HY0gYk+BdQ==","_resolved":"C:\\Users\\caleb\\AppData\\Local\\Temp\\60d43676f405879b6091acbaabcf381f\\caleblawson-auth-workos-0.10.1.tgz","_from":"file:caleblawson-auth-workos-0.10.1.tgz","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-yrdP/txWTH2uxrelVcEkgppzyD0/6pg6WlZ/Mev9khKoZfZOaPrjg8ofaOzSbPy7KLa5djdZxgU+HY0gYk+BdQ==","shasum":"1fdb8ebc03f24b1786f86590d89079ca793bc1e3","tarball":"https://registry.npmjs.org/@caleblawson/auth-workos/-/auth-workos-0.10.1.tgz","fileCount":23,"unpackedSize":120220,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCgpLc5gfSIsrLXgIlaCXDzR6ol3AUq69QrjIzyPtDJ3gIhAL9KBltvh7qtPl6iTHfSl4+znRb832Sgl6mRThCRPFfe"}]},"_npmUser":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","actor":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","type":"user"}},"directories":{},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-workos_0.10.1_1750378175332_0.31192183487872627"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-20T00:09:35.238Z","0.10.1":"2025-06-20T00:09:35.554Z","modified":"2025-06-20T00:09:35.826Z"},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"description":"Mastra WorkOS Auth integration","license":"Elastic-2.0","readme":"# @mastra/auth-workos\r\n\r\nA WorkOS authentication provider for Mastra, enabling seamless integration of WorkOS authentication and authorization in your applications.\r\n\r\n## Features\r\n\r\n- 🔐 WorkOS authentication integration\r\n- 👥 User management and organization membership support\r\n- 🔑 JWT token verification using WorkOS JWKS\r\n- 👮‍♂️ Role-based authorization with admin role support\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @mastra/auth-workos\r\n# or\r\nyarn add @mastra/auth-workos\r\n# or\r\npnpm add @mastra/auth-workos\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { Mastra } from '@mastra/core';\r\nimport { MastraAuthWorkos } from '@mastra/auth-workos';\r\n\r\n// Initialize with environment variables\r\nconst auth = new MastraAuthWorkos();\r\n\r\n// Or initialize with explicit configuration\r\nconst auth = new MastraAuthWorkos({\r\n  apiKey: 'your_workos_api_key',\r\n  clientId: 'your_workos_client_id',\r\n});\r\n\r\n// Enable auth in Mastra\r\nconst mastra = new Mastra({\r\n  ...\r\n  server: {\r\n    experimental_auth: auth,\r\n  },\r\n});\r\n```\r\n\r\n## Configuration\r\n\r\nThe package requires the following configuration:\r\n\r\n### Environment Variables\r\n\r\n- `WORKOS_API_KEY`: Your WorkOS API key\r\n- `WORKOS_CLIENT_ID`: Your WorkOS client ID\r\n\r\n### Options\r\n\r\nYou can also provide these values directly when initializing the provider:\r\n\r\n```typescript\r\ninterface MastraAuthWorkosOptions {\r\n  apiKey?: string;\r\n  clientId?: string;\r\n}\r\n```\r\n\r\n## API\r\n\r\n### `authenticateToken(token: string): Promise<WorkosUser | null>`\r\n\r\nVerifies a JWT token using WorkOS JWKS and returns the user information if valid.\r\n\r\n### `authorizeUser(user: WorkosUser): Promise<boolean>`\r\n\r\nChecks if a user has admin privileges by verifying their organization memberships and roles.\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-27d476140bdc8452fa23aa601d0a43d2"}