rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Convex Auth — Multi-Provider Sign-in

@convex-dev/auth: props-driven AuthCard (google · github · magic-link · password · phone OTP). 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-dev/auth: props-driven AuthCard (google · github · magic-link · password · phone OTP). 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
# 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`
- 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`. Then create convex/auth.ts using the kitab pattern (Resend provider). Set env via `npx convex env set` for self-hosted.

## 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.