
Pinme Auth
This wraps PinMe's Identity Platform auth proxy so your TypeScript Workers can create email/password users, verify id_tokens, and query user info without managing Firebase admin SDKs directly. You get four endpoints: create_user (sends verification emails automatically), verify_token (returns 403 specifically for unverified emails, not 401), get single user, and list users with pagination up to 1000 per page. Everything authenticates with X-API-Key header plus project_name query param, which the proxy maps to your tenant_id before hitting Google Identity Platform. The separation between server API_KEY and public auth_api_key for frontend Firebase init is clean. Useful if you're building on PinMe and want backend auth logic without pulling in heavyweight dependencies.
- skills.sh installs
- 511
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add glitternetwork/pinme --skill pinme-auth --agent claude-codeInstalls into .claude/skills of the current project.
Files
PinMe Worker Auth API Integration
Guides how to call PinMe platform's Identity Platform auth proxy APIs in a PinMe Worker (TypeScript).
Environment Variables
// backend/src/worker.ts
export interface Env {
DB: D1Database;
API_KEY: string; // 项目 API Key — 用于所有 auth 接口认证
PROJECT_NAME: string; // 项目名 — 所有 auth 接口必须同时传递
BASE_URL?: string; // 可选,默认 https://pinme.cloud
}
API_KEY和PROJECT_NAME是所有 auth 接口的必填凭证,缺一不可。
认证方式(所有接口通用)
| 参数 | 传递方式 | 必填 | 说明 |
|---|---|---|---|
X-API-Key | 请求头 | 是 | 项目 API Key |
project_name | Query 参数 | 是 | 必须与 X-API-Key 对应同一个项目 |
服务端会先校验这两个字段是否匹配同一个项目,再从项目配置中取出 tenant_id,然后转调 Identity Platform。
通用错误
| 场景 | HTTP | data.error |
|---|---|---|
缺少 X-API-Key | 401 | X-API-Key header is required |
缺少 project_name | 400 | project_name is required |
| API Key 和项目不匹配 | 401 | Invalid API key or project name |
| 项目未配置认证租户 | 400 | Auth service not configured for this project |
通用 TypeScript 类型
type ApiEnvelope<T> = {
code: number // 200=成功,其他=失败
msg: string // "ok" | "fail" | "invalid param"
data: T
}
Sponsors
Details
- Repository
- github.com/glitternetwork/pinme
- Categories
- Backend & APIs, Security
- License
- MIT
- First seen
- Jun 3, 2026