PinMe Worker Auth API Integration
Integrate user authentication into PinMe Worker (TypeScript) with create user, verify token, and user query/list APIs.
The skill demonstrates least privilege by clearly separating API keys: frontend only uses public_client_config's Firebase Web API Key, while project API key is for server-side Worker only, and explicitly warns not to hold project api_key in frontend. It also clearly explains authentication method and error handling. However, missing explicit user confirmation steps, no data-flow transparency details, and no rollback mechanisms (except create_user auto rollback) reduce score.
The skill provides multiple TypeScript examples and error tables that appear self-consistent, but lacks automated tests covering the auth endpoints. Repository has CLI tests but they don't cover this skill's core paths. Static analysis cannot confirm execution, so reliability is capped and deducted for lack of test coverage.
Skill clearly defines target scenarios (PinMe Worker projects needing auth integration) and environment requirements, but lacks explicit non-fit boundaries and doesn't address mainland-China accessibility of pinme.cloud services. This deduction reflects incomplete environment fit.
Document is well-structured with environment variables, auth method, common errors, API details and examples, but lacks installation steps, versioning/changelog, and maintenance responsibility details. License is MIT and clear, but author identity is not specified, so governance and maintainability are incomplete.
Skill describes complete workflows and gives usable TypeScript snippets, but no execution verification. The value depends on PinMe platform services and integration, but actual run results are unverified, so effectiveness is capped and deducted.
Repository has CI workflow and test suites, but tests don't cover this skill's auth interface calls. API examples and error tables are author claims without independent verification. Static review cannot execute, so evidence is limited, deducting score.
- The skill depends on PinMe platform services (pinme.cloud) and Firebase Auth, which may be unreachable in mainland-China networks; assess network accessibility.
- The skill lacks explicit user confirmation steps; ensure permission controls when executing sensitive operations automatically.
- API Key and project_name are sensitive credentials; ensure they are not leaked, especially in automated environments.
- Example code in the skill is not verified; test before use.
What does this skill do, and when should you use it?
This skill guides how to call PinMe platform's Identity Platform auth proxy APIs from a PinMe Worker (TypeScript). It covers environment variable setup, common authentication (X-API-Key header + project_name query param), common error handling, and TypeScript types. The provided APIs include create_user, verify_token, get_user, and list_users, with complete frontend integration examples using Firebase Auth. The skill is part of the PinMe project template and requires a Worker environment configured with the necessary API keys and env vars.
Provides guides and TypeScript examples for four auth proxy APIs:
- Create user (email/password registration, with verification email sent)
- Verify id_token (works for email/password and Google login)
- Get a single user by UID
- List users with pagination
Also explains env var configuration for API key and project name, and how the frontend uses Firebase Auth to obtain id_token, which the Worker then verifies.
- Implement email/password registration in a PinMe Worker project, handling email verification flow.
- Verify id_token from frontend login, distinguishing between invalid token (401) and unverified email (403).
- Query full user info by uid for admin dashboards or user detail views.
- Batch fetch all users for user management or data sync.
What are this skill's strengths and limitations?
- Clear API documentation with TypeScript examples, simplifying integration.
- Unified auth method reduces complexity.
- Covers common error scenarios like email unverified (403).
- Provides complete pagination example for listing all users.
- Limited to PinMe platform; not portable to other hosting.
- Documentation is primarily in Chinese; English users may face language barrier.
- Depends on project structure created by PinMe CLI.
- No mention of test cases or test framework, missing validation.
How do you install this skill?
This skill is part of the PinMe project template, generated by pinme create. To install the skill collection separately, run npx skills add glitternetwork/pinme (from README). The skill file is located at skills/pinme-auth/SKILL.md in the repository.
How do you use this skill?
- Ensure your Worker project has env vars:
DB(D1 database),API_KEY(project API key),PROJECT_NAME, and optionallyBASE_URLto override defaulthttps://pinme.cloud. - In your TypeScript code, use the provided example functions (e.g.,
createAuthUser,verifyAuthToken) or implement your own. - Always set
X-API-Keyheader andproject_namequery param for each request. - For frontend integration, use the
public_client_configgenerated bypinme createto initialize Firebase Auth SDK, ensuring you settenant_id. After obtaining id_token in the frontend, send it to your Worker, which then callsverify_token.