-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add Cloudflare Workers deployment for example app #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,5 +16,8 @@ yarn.lock | |
| .vinxi/ | ||
| dist/ | ||
| coverage/ | ||
| .wrangler/ | ||
| .dev.vars* | ||
| !.dev.vars.example | ||
|
|
||
| test-results/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Used by Cloudflare local preview. Do not commit real secrets. | ||
| WORKOS_REDIRECT_URI="http://localhost:3000/api/auth/callback" | ||
| WORKOS_API_KEY="<YOUR_API_KEY>" | ||
| WORKOS_CLIENT_ID="<YOUR_CLIENT_ID>" | ||
| WORKOS_COOKIE_PASSWORD="<YOUR_COOKIE_PASSWORD>" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,8 @@ | ||
| import { createStart } from '@tanstack/react-start'; | ||
| import { authkitMiddleware } from '@workos/authkit-tanstack-react-start'; | ||
|
|
||
| /** | ||
| * Configure TanStack Start with AuthKit middleware. | ||
| * The middleware runs on every server request and provides auth context. | ||
| */ | ||
| export const startInstance = createStart(() => { | ||
| return { | ||
| // Run AuthKit middleware on every request | ||
| requestMiddleware: [authkitMiddleware()], | ||
| }; | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "node_modules/wrangler/config-schema.json", | ||
| "name": "authkit-tanstack-start-example", | ||
| "compatibility_date": "2026-05-18", | ||
| "compatibility_flags": ["nodejs_compat"], | ||
| "main": "@tanstack/react-start/server-entry", | ||
| "observability": { | ||
| "enabled": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,7 +35,9 @@ | |||||
| "test": "vitest run", | ||||||
| "test:watch": "vitest", | ||||||
| "test:ui": "vitest --ui", | ||||||
| "test:coverage": "vitest run --coverage" | ||||||
| "test:coverage": "vitest run --coverage", | ||||||
| "deploy:example": "node --experimental-strip-types scripts/deploy-example-cloudflare.ts", | ||||||
| "deploy:example:secrets": "wrangler secret bulk example/.env --config example/wrangler.jsonc" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 The root
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||
| }, | ||||||
| "keywords": [ | ||||||
| "workos", | ||||||
|
|
@@ -81,6 +83,7 @@ | |||||
| "@testing-library/jest-dom": "^6.9.1", | ||||||
| "@testing-library/react": "^16.3.1", | ||||||
| "@testing-library/user-event": "^14.6.1", | ||||||
| "@types/node": "^25.9.0", | ||||||
| "@types/react": "^19.2.7", | ||||||
| "@types/react-dom": "^19.2.2", | ||||||
| "@vitest/coverage-v8": "4.0.15", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrangleris only a devDependency ofexample/, not the root package. In a pnpm workspace without shameful hoisting, binaries from child-workspace packages are not placed in the rootnode_modules/.bin, so runningpnpm run deploy:example:secretsfrom the repo root will fail with "command not found: wrangler". The fix is to delegate to the example workspace, wherewrangleris available.