vtex-io-auth-tokens-and-context — Claude Code skill for VTEX IO tokens
Decides which VTEX IO token should back a backend request: the app itself, a shopper, or an Admin user.
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a claude-codeWhat vtex-io-auth-tokens-and-context does
The skill applies when the open question is which identity authenticates a call to VTEX services. It covers three options: ctx.authToken for app-level work, ctx.storeUserAuthToken for storefront and shopper-triggered flows, and ctx.adminUserAuthToken for Admin requests that must respect the logged-in user's License Manager role.
Inside are decision rules, a token-to-context table, and hard constraints with TypeScript examples. If a shopper or Admin user started the request, the skill pushes for the user token instead of the app token. Clients that accept authMethod get the token choice passed explicitly. When you wrap a custom VTEX client, the matching token travels from IOContext at the client boundary rather than being hardcoded in handlers.
ADMIN_TOKEN with ctx.adminUserAuthToken stays server-side: never expose it or proxy it to a browser client. Raw tokens should not be logged or returned in responses either. Policy design in manifest.json, route-level authorization, and the choice between ExternalClient and JanusClient sit outside this skill.
What it helps with
- pick a token for a storefront request without escalating to app permissions
- decide which identity an Admin-triggered VTEX client call should use
- strip hardcoded
appKeyandappTokenfrom a VTEX IO app - check whether an Admin token leaks into a browser client
- propagate the right token from
IOContextwhen wrapping a client
Example prompts for the agent
- Which token goes in the client header for a request that came from the storefront?
- Review my
OmsClient: should this bectx.storeUserAuthTokenorctx.authToken? - Replace the hardcoded
appKeyandappTokenwith the token fromIOContext
How to install vtex-io-auth-tokens-and-context
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a claude-code2Manually: put the files in place
~/.claude/skills/vtex-io-auth-tokens-and-context/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vtex-io-auth-tokens-and-context/
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a codex2Manually: put the files in place
.agents/skills/vtex-io-auth-tokens-and-context/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a cursor2Manually: put the files in place
.cursor/skills/vtex-io-auth-tokens-and-context/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vtex/skills vtex-io-auth-tokens-and-context2Manually: put the files in place
.github/skills/vtex-io-auth-tokens-and-context/SKILL.md1Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a gemini-cli2Platform CLI
gemini skills install https://github.com/vtex/skills --path skills/vtex-io-auth-tokens-and-contextManually: put the files in place
.devin/skills/vtex-io-auth-tokens-and-context/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about vtex-io-auth-tokens-and-context
How do I install vtex-io-auth-tokens-and-context in Claude?
Run npx skills add vtex/skills --skill vtex-io-auth-tokens-and-context -a claude-code. The skill file then lands at ~/.claude/skills/vtex-io-auth-tokens-and-context/SKILL.md.
What does vtex-io-auth-tokens-and-context do?
It helps you choose between ctx.authToken, ctx.storeUserAuthToken, and ctx.adminUserAuthToken for a request from a VTEX IO backend app. It also covers authMethod and passing the token at the client boundary.
What is out of scope for this skill?
Policies in manifest.json, route-level authorization, and picking between ExternalClient and JanusClient. Those belong to other skills.