| name | signaldesk-enable-auth |
| description | Turn on Convex Auth in the SignalDesk starter. Use when an attendee wants login, sign up, user accounts, or protected functions added to their forked SignalDesk app. |
Enable auth in SignalDesk
SignalDesk ships with auth off so it runs with zero config. Use this skill to
add Convex Auth. The default path uses the Password provider so no OAuth keys are
needed. Follow docs/AUTH.md in the repo as the source of truth and keep changes
minimal.
Before you start
Confirm with the user:
- Provider: Password (default, no keys) or an OAuth provider like GitHub or
Google (needs client id and secret).
- Whether all functions should require sign in, or only some.
Steps
-
Install packages:
npm install @convex-dev/auth @auth/core
-
Run the auth setup helper to generate keys and env vars:
npx @convex-dev/auth
-
Create convex/auth.ts exporting convexAuth with the chosen provider.
-
Spread authTables into convex/schema.ts.
-
Add auth.addHttpRoutes(http) in convex/http.ts, keeping the existing
registerStaticRoutes call.
-
Swap ConvexProvider for ConvexAuthProvider in src/main.tsx.
-
Add a sign in form gated by <Authenticated> and <Unauthenticated>.
-
Protect Convex functions with getAuthUserId(ctx) where needed.
-
Set VITE_AUTH_ENABLED=true in .env.local.
Rules
- Keep argument and return validators on every Convex function.
- Do not store secrets in the database or in frontend env files. OAuth secrets
go in Convex env vars via
npx convex env set.
- Run
npm run typecheck and npm run lint after wiring it up.
- Verify: sign up, sign out, sign in, and confirm a protected function rejects an
unauthenticated call.
References