add-api-auth
Installation
SKILL.md
Add API auth
Add an API key or client credentials to protect an API. Then stop.
Guardrails
- MUST read
SCALEKIT_ENVIRONMENT_URL,SCALEKIT_CLIENT_ID,SCALEKIT_CLIENT_SECRETfrom env. MUST NOT hardcode them. - MUST validate the token server-side on every request. Return 401 on invalid, expired, or revoked.
- MUST show plain-text
token/plainSecretonce. StoretokenIdfor list and invalidate. MUST NOT log or commit the secret.
Gotchas
- Default language is Node. Default path is an org-scoped opaque API key.
- Client credentials / M2M JWT is a different API. Open references/client-credentials.md. Do not call
createTokenon that path. - Python, Go, or Java → open references/languages.md.
- Never
SCALEKIT_ENV_URL. Do not prependhttps://if the env URL already has a scheme. - Copy the organization ID from the dashboard. Do not invent
org_…values. scalekit.token.validateTokenis for opaque keys.scalekit.validateTokenis for JWTs. Do not mix them.- Install
@scalekit-sdk/nodeonly when the repo has no Scalekit SDK yet.