Tooluck logoTooluck
SKILL.md

pinme-auth

Agent skill fromglitternetwork/pinme

Use when a PinMe project (Worker TypeScript) needs to integrate user authentication — creating email/password users, verifying id_tokens, querying user info, or listing users via Identity Platform auth proxy APIs.

How to install pinme-auth

install pinme-auth
# install the pinme pack with the skills CLI
npx skills add glitternetwork/pinme

# or add only this skill to Claude Code: copy the folder

skills/pinme-auth/

# into

~/.claude/skills/pinme-auth/ (all projects)

.claude/skills/pinme-auth/ (one project)

skills/pinme-auth/SKILL.md

MITFull file
1# PinMe Worker Auth API Integration
2
3Guides how to call PinMe platform's Identity Platform auth proxy APIs in a PinMe Worker (TypeScript).
4
5## Environment Variables
6
7```typescript
8// backend/src/worker.ts
9export interface Env {
10 DB: D1Database;
11 API_KEY: string; // 项目 API Key — 用于所有 auth 接口认证
12 PROJECT_NAME: string; // 项目名 — 所有 auth 接口必须同时传递
13 BASE_URL?: string; // 可选,默认 https://pinme.cloud
14}
15```
16
17> `API_KEY` 和 `PROJECT_NAME` 是所有 auth 接口的必填凭证,缺一不可。
18
19---
20
21## 认证方式(所有接口通用)
22
23| 参数 | 传递方式 | 必填 | 说明 |
24|------|---------|------|------|
25| `X-API-Key` | 请求头 | 是 | 项目 API Key |
26| `project_name` | Query 参数 | 是 | 必须与 `X-API-Key` 对应同一个项目 |
27
28服务端会先校验这两个字段是否匹配同一个项目,再从项目配置中取出 `tenant_id`,然后转调 Identity Platform。
29
30---
31
32## 通用错误
33
34| 场景 | HTTP | `data.error` |
35|------|------|-------------|
36| 缺少 `X-API-Key` | 401 | `X-API-Key header is required` |
37| 缺少 `project_name` | 400 | `project_name is required` |
38| API Key 和项目不匹配 | 401 | `Invalid API key or project name` |
39| 项目未配置认证租户 | 400 | `Auth service not configured for this project` |
40
41---
42
43## 通用 TypeScript 类型
44
45```typescript
46type ApiEnvelope<T> = {
47 code: number // 200=成功,其他=失败
48 msg: string // "ok" | "fail" | "invalid param"
49 data: T
50}
51
52type ApiErrorData = { error?: string }
53
54type UserInfo = {
55 uid: string
56 email: string
57 display_name: string
58 photo_url?: string
59 disabled: boolean
60 email_verified: boolean
61}
62```
63
64---
65
66## API 1: 创建用户
67
68**Endpoint:** `POST {BASE_URL}/api/v1/auth/create_user?project_name={project_name}`
69…

Excerpt shown under the repository's MIT license.

More skills in pinme

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates