workos 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +7 -3
  2. package/dist/bin.js +10 -4
  3. package/dist/bin.js.map +1 -1
  4. package/dist/doctor/checks/auth-patterns.js +1 -1
  5. package/dist/doctor/checks/auth-patterns.js.map +1 -1
  6. package/dist/lib/adapters/cli-adapter.d.ts +7 -0
  7. package/dist/lib/adapters/cli-adapter.js +49 -0
  8. package/dist/lib/adapters/cli-adapter.js.map +1 -1
  9. package/dist/lib/adapters/dashboard-adapter.d.ts +4 -0
  10. package/dist/lib/adapters/dashboard-adapter.js +24 -0
  11. package/dist/lib/adapters/dashboard-adapter.js.map +1 -1
  12. package/dist/lib/adapters/headless-adapter.d.ts +6 -0
  13. package/dist/lib/adapters/headless-adapter.js +26 -1
  14. package/dist/lib/adapters/headless-adapter.js.map +1 -1
  15. package/dist/lib/agent-runner.js +55 -16
  16. package/dist/lib/agent-runner.js.map +1 -1
  17. package/dist/lib/events.d.ts +15 -0
  18. package/dist/lib/events.js.map +1 -1
  19. package/dist/lib/installer-core.d.ts +61 -1
  20. package/dist/lib/installer-core.js +132 -6
  21. package/dist/lib/installer-core.js.map +1 -1
  22. package/dist/lib/installer-core.types.d.ts +24 -0
  23. package/dist/lib/installer-core.types.js.map +1 -1
  24. package/dist/lib/run-with-core.js +26 -1
  25. package/dist/lib/run-with-core.js.map +1 -1
  26. package/dist/lib/scaffold/index.d.ts +1 -0
  27. package/dist/lib/scaffold/index.js +2 -0
  28. package/dist/lib/scaffold/index.js.map +1 -0
  29. package/dist/lib/scaffold/scaffold.d.ts +66 -0
  30. package/dist/lib/scaffold/scaffold.js +156 -0
  31. package/dist/lib/scaffold/scaffold.js.map +1 -0
  32. package/dist/lib/validation/security-checks.d.ts +35 -0
  33. package/dist/lib/validation/security-checks.js +105 -0
  34. package/dist/lib/validation/security-checks.js.map +1 -0
  35. package/dist/run.d.ts +2 -2
  36. package/dist/run.js +2 -1
  37. package/dist/run.js.map +1 -1
  38. package/dist/utils/types.d.ts +10 -4
  39. package/dist/utils/types.js.map +1 -1
  40. package/package.json +2 -2
package/README.md CHANGED
@@ -23,6 +23,7 @@ shell command cache.
23
23
  - **AI-Powered:** Uses Claude to intelligently adapt to your project structure
24
24
  - **Security-First:** Masks API keys, redacts from logs, saves to .env.local
25
25
  - **Smart Detection:** Auto-detects framework, package manager, router type
26
+ - **Greenfield Scaffolding:** Run in an empty directory to scaffold a new Next.js app (via `create-next-app`) before wiring AuthKit
26
27
  - **Live Documentation:** Fetches latest SDK docs from WorkOS and GitHub
27
28
  - **Full Integration:** Creates routes, middleware, environment vars, and UI
28
29
  - **Agent & CI Ready:** Non-TTY auto-detection, JSON output, structured errors, headless installer with NDJSON streaming
@@ -570,12 +571,13 @@ workos org-domain delete <id>
570
571
  workos install [options]
571
572
 
572
573
  --direct, -D Use your own Anthropic API key (bypass llm-gateway)
573
- --integration <name> Framework: nextjs, react, react-router, tanstack-start, vanilla-js, sveltekit, node, python, ruby, go, dotnet, kotlin, elixir, php-laravel, php
574
574
  --api-key <key> WorkOS API key (required in non-interactive mode)
575
575
  --client-id <id> WorkOS client ID (required in non-interactive mode)
576
576
  --redirect-uri <uri> Custom redirect URI
577
577
  --homepage-url <url> Custom homepage URL
578
578
  --install-dir <path> Installation directory
579
+ --scaffold Scaffold a new Next.js app when run in an empty directory
580
+ --pm <manager> Package manager for the scaffolded app: npm, pnpm, yarn, bun
579
581
  --no-validate Skip post-installation validation
580
582
  --no-branch Skip branch creation (use current branch)
581
583
  --no-commit Skip auto-commit after installation
@@ -585,14 +587,16 @@ workos install [options]
585
587
  --debug Enable verbose logging
586
588
  ```
587
589
 
590
+ **Empty directories:** Running `workos install` in an empty directory scaffolds a new Next.js app with `create-next-app` (App Router, TypeScript, Tailwind, `src/`) and then wires AuthKit into it. This only happens when the directory is empty or contains nothing but VCS/editor metadata (`.git`, `.gitignore`, `LICENSE`, `.idea`, and similar). Any project file — including a `README.md` or a `package.json` — opts out, and the installer treats the directory as an existing project. Interactive runs confirm first (default yes); non-interactive/headless runs (or `--scaffold`) scaffold automatically and report `"scaffolded": true`. The package manager is resolved from how you invoked the CLI (`npm_config_user_agent`) unless you pass `--pm`.
591
+
588
592
  ## Examples
589
593
 
590
594
  ```bash
591
595
  # Interactive (recommended)
592
596
  npx workos@latest install
593
597
 
594
- # Specify framework
595
- npx workos@latest install --integration react-router
598
+ # Greenfield: scaffold a new Next.js app + AuthKit in an empty directory
599
+ mkdir my-app && cd my-app && npx workos@latest install
596
600
 
597
601
  # With visual dashboard (experimental)
598
602
  npx workos@latest dashboard
package/dist/bin.js CHANGED
@@ -167,10 +167,6 @@ const installerOptions = {
167
167
  describe: 'Directory to install WorkOS AuthKit in',
168
168
  type: 'string',
169
169
  },
170
- integration: {
171
- describe: 'Integration to set up',
172
- type: 'string',
173
- },
174
170
  'force-install': {
175
171
  default: false,
176
172
  describe: 'Force install packages even if peer dependency checks fail',
@@ -202,6 +198,16 @@ const installerOptions = {
202
198
  describe: 'Check for dirty working tree (use --no-git-check to skip)',
203
199
  type: 'boolean',
204
200
  },
201
+ scaffold: {
202
+ default: false,
203
+ describe: 'Scaffold a new Next.js app when run in an empty directory',
204
+ type: 'boolean',
205
+ },
206
+ pm: {
207
+ describe: 'Package manager for the scaffolded app',
208
+ choices: ['npm', 'pnpm', 'yarn', 'bun'],
209
+ type: 'string',
210
+ },
205
211
  };
206
212
  // Check for updates (blocks up to 500ms, skip in JSON/non-human modes to keep machine streams clean)
207
213
  if (!isJsonMode() && isPromptAllowed())