convex-auth
Skill này làm gì
Skill này thêm tính năng đăng nhập người dùng cho app xây trên Convex. Nó thiết lập phương thức đăng nhập, cài đặt phía máy chủ và một màn hình đăng nhập cơ bản.
Khi nào nên dùng
- ✓Khi bạn đang xây app Convex và cần người dùng đăng nhập.
- ✓Khi bạn muốn thêm passkey, đăng nhập Google hoặc đăng nhập bằng mật khẩu vào dự án Convex có sẵn.
- ✓Khi thiết lập đăng nhập Convex của bạn đang lỗi vì cấu hình xác thực bị thiếu hoặc sai.
Liên kết skill
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-auth/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm đăng nhập bằng passkey vào app Convex của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent cài thư viện xác thực của Convex, thêm phương thức đăng nhập đã chọn, tạo các khóa cần thiết mà không dùng trình hướng dẫn tương tác, rồi kết nối trang đăng nhập.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Add sign-in to the app
Install and wire @convex-dev/auth for the current app: a provider (passkeys by default, or OAuth/password), the server config, the client hooks, and a sign-in UI — correctly, including the auth.config.ts that's the #1 real-world auth footgun.
Workflow
- Install @convex-dev/auth (pinned build) and add it to convex.config.ts. With pnpm, also
pnpm add jose(it won't hoist otherwise); you need it for step 3. - Add the provider in convex/auth.ts (Passkey by default; Password or OAuth like Google on request).
- Generate the auth keys HEADLESSLY. Do NOT run the interactive
npx @convex-dev/authwizard: it needs a login/TTY and hangs in non-interactive, anonymous, or CI runs (the #1 auth time-sink). Generate JWT_PRIVATE_KEY + JWKS deterministically withjose: node -e 'import("jose").then(async({generateKeyPair,exportPKCS8,exportJWK})=>{const k=await generateKeyPair("RS256",{extractable:true});const priv=await exportPKCS8(k.privateKey);const pub=await exportJWK(k.publicKey);process.stdout.write(JSON.stringify({JWT_PRIVATE_KEY:priv.trimEnd().replace(/\n/g," "),JWKS:JSON.stringify({keys:[{use:"sig",...pub}]})}))})' > .auth-keys.json Then set JWT_PRIVATE_KEY and JWKS (from .auth-keys.json) plus SITE_URL on the deployment. Prefer the Convex MCPenvSettool, one call per var, to avoid shell-quoting the multi-line key. CLI fallback: use the NAME=VALUE form (npx convex env set "JWT_PRIVATE_KEY=$JWT"), NEVERenv set JWT_PRIVATE_KEY "$JWT"(the value starts with-----BEGINand the CLI parses the leading-as an unknown flag). SITE_URL is the dev URL (e.g. http://localhost:3000). Delete .auth-keys.json after. - Write convex/auth.config.ts (the silently-always-signed-out bug lives here if it's wrong).
- Wire the client: ConvexAuthProvider, the sign-in component, and route guards. If you import shadcn/ui primitives (button, input, textarea, label, and so on), add them first with
npx shadcn@latest add <name>; a missing @/components/ui/* is a hard build error. - Verify a sign-in round-trips before declaring done.
Rules
- Generate JWT_PRIVATE_KEY/JWKS with
jose(extractable RS256; PKCS8 newlines to spaces; JWKS = {keys:[{use:"sig", ...publicJwk}]}). Do NOT run the interactivenpx @convex-dev/authwizard: it hangs headless/anonymous. Set the vars via the MCPenvSettool or the NAME=VALUE CLI form. - Always write auth.config.ts: a missing/incorrect one makes the app silently always-signed-out with no error.
- Passkeys by default; only switch to password/OAuth on explicit request.
- Install any shadcn/ui primitive you import up front (
npx shadcn@latest add ...); a missing @/components/ui/* is a hard build failure. - Verify a real sign-in works before finishing.
Câu hỏi thường gặp
Tôi có cần biết lập trình để dùng skill này không?
Có chút hiểu biết kỹ thuật sẽ giúp ích, vì agent sẽ sửa file dự án và đặt cài đặt máy chủ. Skill hướng dẫn từng bước.
Skill hỗ trợ những phương thức đăng nhập nào?
Passkey là mặc định. Skill cũng có thể thêm đăng nhập bằng mật khẩu hoặc OAuth, như Google, khi bạn yêu cầu.
Skill có chạy trình hướng dẫn cài đặt cho tôi không?
Không. Skill tránh trình hướng dẫn tương tác vì nó có thể bị treo trong các lần chạy tự động, và thay vào đó tạo khóa trực tiếp.
Chi tiết
Mô tả gốc của tác giả
Add authentication (passkeys/OAuth) to the current Convex app, including the auth.config.ts wiring.
repo: openclaw/clawhub
Độ phổ biến
- Sao GitHub
- 9.5k
- Vị trí xếp hạng
- #12234
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
axiom-alerting
9.5kGiúp agent của bạn tạo và quản lý monitor cùng các tuyến thông báo của Axiom qua API Axiom, và kiểm tra cảnh báo hoạt động đúng như mong đợi.
axiom-sre
9.5kGiúp agent của bạn điều tra sự cố và lỗi production từng bước, kiểm tra mỗi giả thuyết với log Axiom trước khi đưa ra kết luận.
building-dashboards
9.5kGiúp agent của bạn thiết kế dashboard Axiom với biểu đồ, truy vấn và bộ lọc phù hợp, bắt đầu từ các quyết định mà dashboard phải hỗ trợ.
controlling-costs
9.5kGiúp agent của bạn tìm dữ liệu không dùng đến trong Axiom và xây dựng dashboard cùng monitor để theo dõi và giảm chi phí ghi log.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.