Aller au contenu
Skillpedia
API et serveurs (backend)9.5k · #12258

convex-setup-auth

Ce qu’il fait

Cette compétence ajoute l'authentification à une application Convex. Elle vous aide à choisir un fournisseur de connexion, à le relier à vos utilisateurs et à limiter certaines fonctionnalités aux personnes connectées.

Quand l’utiliser

  • ✓Quand vous ajoutez pour la première fois une connexion à une application Convex.
  • ✓Quand vous avez besoin d'une table d'utilisateurs qui relie chaque personne à son identité de connexion.
  • ✓Quand vous voulez limiter certaines fonctions ou pages aux utilisateurs connectés ou à certains rôles.

Lien du skill

https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-setup-auth/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-setup-auth/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Configure la connexion de mon application Convex et fais en sorte que seuls les utilisateurs connectés voient leurs propres éléments.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent demande d'abord quel fournisseur de connexion vous voulez, sauf si votre projet en utilise déjà un. Il configure ensuite le fournisseur, la table d'utilisateurs et les fonctions d'aide qui vérifient qui est connecté.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

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:

  1. Ask the user which auth solution they want, unless the repository already makes it obvious
  2. If the repo already uses a provider, continue with that provider unless the user wants to switch
  3. 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:

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.ts setup
  • 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:

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) => 
Questions fréquentes

Quels fournisseurs de connexion peut-elle configurer ?

Convex Auth, Clerk, WorkOS AuthKit, Auth0 ou une configuration JWT personnalisée, selon votre choix.

Choisira-t-elle un fournisseur à ma place ?

Seulement si votre projet en utilise déjà un. Sinon, l'agent vous demande d'abord.

Est-elle aussi pour d'autres backends ?

Non. Elle est réservée aux applications Convex.

Détails

Description originale de l’auteur

Sets up Convex auth, identity mapping, and access control. Use for login, auth providers, users tables, protected functions, or roles in a Convex app.

repo: openclaw/clawhub

Popularité

Étoiles GitHub
9.5k
Position au classement
#12258
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires