Skip to content
rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Convex Auth — Multi-Provider Sign-in

Convex Auth with React/Next default + native Svelte 5 UI over one shared AuthFlow contract. No Clerk.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
convex-auth.prompt.mdmarkdown
# Install `convex-auth` — Convex Auth — Multi-Provider Sign-in

> Convex Auth with React/Next default + native Svelte 5 UI over one shared AuthFlow contract. No Clerk.

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/convex-auth
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=convex-auth
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/convex-auth

## 1. Install

```bash
npm i @convex-dev/auth @auth/core resend lucide-react
# alias: npx rr add convex-auth
```

The CLI copies `frontend/slices/convex-auth/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.

## 2. What it ships

- npm: `@convex-dev/auth`, `@auth/core`, `resend`, `lucide-react`
- shadcn primitives: `button`, `card`, `input`, `label`, `tabs`, `alert`, `input-otp`
- env vars:
  - `AUTH_RESEND_KEY` (convex)
  - `JWT_PRIVATE_KEY` (convex)
  - `JWKS` (convex)
  - `SITE_URL` (convex)
  - `AUTH_GOOGLE_ID` (convex)
  - `AUTH_GOOGLE_SECRET` (convex)
- convex feature paths: `convex/features/auth`

## 3. Wire it up

Run `rr add convex-auth` for React/Next or `rr add convex-auth --framework sveltekit` for native Svelte. React uses @convex-dev/auth/react. Svelte SignInPage requires a host-supplied AuthFlow because the upstream package has no official Svelte adapter. Keep JWT/OAuth/Resend env server-side.

## Rules of engagement

- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice

The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.