convex-setup-auth
Skill86 starsChanged 7 months agoApache-2.0View on GitHub
Implement secure authentication in Convex with user management and access control. - Setting up authentication for the first time - Implementing user management (users table, identity mapping) - Creating authentication helper functions - Setting up auth providers (Convex Auth, Clerk, WorkOS AuthKit, Auth0, custom JWT) - Auth for a non-Convex backend - Pure OAuth/OIDC documentation without a Convex implementation - Debugging unrelated bugs that happen to surface near auth code - The auth provider is already fully configured and the…
15 other projects use a version of this, 15 of them edited.
Adopted by
Most recently taken up by
- moltbot/molthubedited, first seen Oct 8, 2026
- get-convex/convex-helpersedited, first seen Oct 8, 2026
- clawdbot/clawdhubedited, first seen Oct 8, 2026
- pingdotgg/lawnedited, first seen Oct 8, 2026
- waynesutton/markdown-siteedited, first seen Oct 8, 2026
- openclaw/clawhubedited, first seen Oct 8, 2026
Used with
Projects with it also use clawhub-ban-appeals, clawhub-clawscan and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
openclawSkillclawhub-ban-appeals
Review ClawHub account-ban appeals, distinguish bans from moderation holds or blocked releases, and prepare an evidence-backed moderation decision. Route validated scanner inaccuracies to clawhub-clawscan.
Also in 3 projects that use this
openclawSkillclawhub-clawscan
Investigate ClawScan health alerts, diagnose scanner or ClawHub integration failures, prepare operational repairs, and route validated verdict inaccuracies upstream. Account ban appeals use clawhub-ban-appeals.
Also in 3 projects that use this
FabienGreardSkillconvex-acquire-domain
Find and buy a domain for the current Convex app through Convex, then bind it (labs; spend action).
Also in 3 projects that use this
- +9 more from openclaw
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 15
- openclaw/clawhub★ 9.6k98% same
- clawdbot/clawdhub★ 9.5k98% same
- moltbot/molthub★ 9.5k98% same
- raroque/boop-agent★ 1.3k98% same
- pingdotgg/lawn★ 69098% same
- waynesutton/markdown-site★ 62898% same
- get-convex/convex-helpers★ 496100% same
- sholajegede/mastra-vs-langchain★ 1798% same
- vantageos-agency/vantage-peers★ 4100% same
- Decentralized-Rights-Protocol/Dr-Blockchain★ 2100% same
5 more not listed
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- convex-create-componentSkill
- convex-migration-helperSkill
- convex-performance-auditSkill
- convex-quickstartSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 14 are common, 2 are distinctive, and 0 are very specific to this project.
14
Common
Most of the 15 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 38
Before writing setup code:
- Common: line 40
Ask the user which auth solution they want, unless the repository already makes it obvious
- Common: line 42
If the repo already uses a provider, continue with that provider unless the user wants to switch
- Common: line 44
If the user has not chosen a provider and the repo does not make it obvious, ask before proceeding
- Common: line 60
Look for signals in the repo before asking:
- Common: line 70
Read the provider's official guide and the matching local reference file:
- Common: line 84
Use those sources for:
- Distinctive: line 104
Prefer official docs over recalled steps, because provider CLIs and Convex Auth internals change between versions.
- Common: line 150
Ask whether the user wants local-only setup or production-ready setup now
- Common: line 151
Read the matching provider reference file
- Common: line 152
Follow the official provider docs for current setup details
- Common: line 153
Follow the official Convex docs for shared backend auth behavior, user storage, and authorization patterns
- Common: line 155
Only add app-level user storage if the docs and app requirements call for it
- Common: line 156
Add authorization checks for ownership, roles, or team access only where the app needs them
- Common: line 158
Verify login state, protected queries, environment variables, and production configuration if requested
- Distinctive: line 161
If the flow blocks on interactive provider or deployment setup, ask the user explicitly for the exact human step needed, then continue …
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Convex Authentication Setup
Implement secure authentication in Convex with user management and access control.
When to Use
- Setting up authentication for the first time
- Implementing user management (users table, identity mapping)
- Creating authentication helper functions
- Setting up auth providers (Convex Auth, Clerk, WorkOS AuthKit, Auth0, custom JWT)
When Not to Use
- Auth for a non-Convex backend
- Pure OAuth/OIDC documentation without a Convex implementation
- Debugging unrelated bugs that happen to surface near auth code
- The auth provider is already fully configured and the user only needs a one-line fix
First Step: Choose the Auth Provider
Convex supports multiple authentication approaches. Do not assume a provider.
Before writing setup code:
- Ask the user which auth solution they want, unless the repository already makes it obvious
- If the repo already uses a provider, continue with that provider unless the user wants to switch
- If the user has not chosen a provider and the repo does not make it obvious, ask before proceeding
Common options:
- Convex Auth - good default when the user wants auth handled directly in Convex
- Clerk - use when the app already uses Clerk or the user wants Clerk's hosted auth features
- WorkOS AuthKit - use when the app already uses WorkOS or the user wants AuthKit specifically
- Auth0 - use when the app already uses Auth0
- Custom JWT provider - use when integrating an existing auth system not covered above
Look for signals in the repo before asking:
- Dependencies such as
@clerk/*,@workos-inc/*,@auth0/*, or Convex Auth packages - Existing files such as
convex/auth.config.ts, auth middleware, provider wrappers, or login components - Environment variables that clearly point at a provider
After Choosing a Provider
Read the provider's official guide and the matching local reference file:
- Convex Auth: official docs, then
references/convex-auth.md - Clerk: official docs, then
references/clerk.md - WorkOS AuthKit: official docs, then
references/workos-authkit.md - Auth0: official docs, then
references/auth0.md
The local reference files contain the concrete workflow, expected files and env vars, gotchas, and validation checks.
Use those sources for:
- package installation
- client provider wiring
- environment variables
convex/auth.config.tssetup- login and logout UI patterns
- framework-specific setup for React, Vite, or Next.js
For shared auth behavior, use the official Convex docs as the source of truth:
- Auth in Functions for
ctx.auth.getUserIdentity() - Storing Users in the Convex Database for optional app-level user storage
- Authentication for general auth and authorization guidance
- Convex Auth Authorization when the provider is Convex Auth
Prefer official docs over recalled steps, because provider CLIs and Convex Auth
internals change between versions. Inventing setup from memory risks outdated
patterns. For third-party providers, only add app-level user storage if the app
actually needs user documents in Convex. Not every app needs a users table.
For Convex Auth, follow the Convex Auth docs and built-in auth tables rather
than adding a parallel users table plus storeUser flow, because Convex Auth
already manages user records internally. After running provider initialization
commands, verify generated files and complete the post-init wiring steps the
provider reference calls out. Initialization commands rarely finish the entire
integration.
Core Pattern: Protecting Backend Functions
The most common auth task is checking identity in Convex functions.
// Bad: trusting a client-provided userId
export const getMyProfile = query({
args: { userId: v.id("users") },
handler: async (ctx, args) => {
return await ctx.db.get(args.userId);
},
});// Good: verifying identity server-side
export const getMyProfile = query({
args: {},
handler: async (ctx) => {
const identity = await ctx.auth.getUserIdentity();
if (!identity) throw new Error("Not authenticated");
return await ctx.db
.query("users")
.withIndex("by_tokenIdentifier", (q) =>
q.eq("tokenIdentifier", identity.tokenIdentifier),
)
.unique();
},
});Workflow
- Determine the provider, either by asking the user or inferring from the repo
- Ask whether the user wants local-only setup or production-ready setup now
- Read the matching provider reference file
- Follow the official provider docs for current setup details
- Follow the official Convex docs for shared backend auth behavior, user storage, and authorization patterns
- Only add app-level user storage if the docs and app requirements call for it
- Add authorization checks for ownership, roles, or team access only where the app needs them
- Verify login state, protected queries, environment variables, and production configuration if requested
If the flow blocks on interactive provider or deployment setup, ask the user explicitly for the exact human step needed, then continue after they complete it. For UI-facing auth flows, offer to validate the real sign-up or sign-in flow after setup is done. If the environment has browser automation tools, you can use them. If it does not, give the user a short manual validation checklist instead.
Reference Files
Provider References
references/convex-auth.mdreferences/clerk.mdreferences/workos-authkit.mdreferences/auth0.md
Checklist
- Chosen the correct auth provider before writing setup code
- Read the relevant provider reference file
- Asked whether the user wants local-only setup or production-ready setup
- Used the official provider docs for provider-specific wiring
- Used the official Convex docs for shared auth behavior and authorization patterns
- Only added app-level user storage if the app actually needs it
- Did not invent a cross-provider
userstable orstoreUserflow for Convex Auth - Added authentication checks in protected backend functions
- Added authorization checks where the app actually needs them
- Clear error messages ("Not authenticated", "Unauthorized")
- Client auth provider configured for the chosen provider
- If requested, production auth setup is covered too
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

