本文へスキップ
Skillpedia
APIとサーバー(バックエンド)9.5k · #12258

convex-setup-auth

できること

このスキルは、Convexのアプリに認証を加えます。ログインのプロバイダを選び、それをユーザーに結びつけ、特定の機能をサインイン済みの人やある役割の人に限る手助けをします。

使う場面

  • ✓Convexのアプリに初めてログインを加えるとき。
  • ✓各人をそのログインのIDに結びつけるユーザーのテーブルが必要なとき。
  • ✓一部の関数やページを、サインイン済みのユーザーや特定の役割に限りたいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-setup-auth/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Convexのアプリにログインを設定して、サインイン済みのユーザーだけが自分の項目を見られるようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、プロジェクトがまだどのプロバイダも使っていなければ、どのログインのプロバイダを使いたいかを先に尋ねます。その後、プロバイダ、ユーザーのテーブル、サインイン済みかを確認するヘルパーの関数を設定します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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) => 
よくある質問

どのログインのプロバイダを設定できますか?

選んだものによって、Convex Auth、Clerk、WorkOS AuthKit、Auth0、またはカスタムのJWTの設定があります。

私のためにプロバイダを選びますか?

プロジェクトが既に使っている場合だけです。そうでなければ、エージェントが先にあなたに尋ねます。

他のバックエンドにも使えますか?

いいえ。Convexのアプリ専用です。

詳細

作者による元の説明

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

人気

GitHubのスター
9.5k
ランキング
#12258
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル