SDK-first frontend integration for Medusa storefronts with React Query patterns and critical API calling rules.
Works with
Always use the Medusa JS SDK for all API requests—never use regular fetch(), as it lacks required headers (publishable API key for store routes, auth for admin routes)
Pass plain JavaScript objects to SDK methods; never use JSON.stringify() on body parameters, as the SDK handles serialization automatically
Use useQuery for GET requests and useMutation for POST/DELETE reques
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionbuilding-storefrontsExecute the skills CLI command in your project's root directory to begin installation:
Fetches building-storefronts from medusajs/medusa-agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate building-storefronts. Access via /building-storefronts in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
128
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
128
stars
Frontend integration guide for building storefronts with Medusa. Covers SDK usage, React Query patterns, and calling custom API routes.
Load this skill for ANY storefront development task, including:
Also load building-with-medusa when: Building the backend API routes that the storefront calls
The quick reference below is NOT sufficient for implementation. You MUST load the reference file before writing storefront integration code.
Load this reference when implementing storefront features:
references/frontend-integration.md firstreferences/frontend-integration.md firstreferences/frontend-integration.md first| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | SDK Usage | CRITICAL | sdk- |
| 2 | React Query Patterns | HIGH | query- |
| 3 | Data Display | HIGH (includes CRITICAL price rule) | display- |
| 4 | Error Handling | MEDIUM | error- |
sdk-always-use - ALWAYS use the Medusa JS SDK for ALL API requests - NEVER use regular fetch()sdk-existing-methods - For built-in endpoints, use existing SDK methods (sdk.store.product.list(), sdk.admin.order.retrieve())sdk-client-fetch - For custom API routes, use sdk.client.fetch()sdk-required-headers - SDK automatically adds required headers (publishable API key for store, auth for admin) - regular fetch() missing these headers causes errorssdk-no-json-stringify - NEVER use JSON.stringify() on body - SDK handles serialization automaticallysdk-plain-objects - Pass plain JavaScript objects to body, not stringssdk-locate-first - Always locate where SDK is instantiated in the project before using itquery-use-query - Use useQuery for GET requests (data fetching)query-use-mutation - Use useMutation for POST/DELETE requests (mutations)query-invalidate - Invalidate queries in onSuccess to refresh data after mutationsquery-keys-hierarchical - Structure query keys hierarchically for effective cache managementquery-loading-states - Always handle isLoading, isPending, isError statesdisplay-price-format - CRITICAL: Prices from Medusa are stored as-is ($49.99 = 49.99, NOT in cents). Display them directly - NEVER divide by 100error-on-error - Implement onError callback in mutations to handle failureserror-display - Show error messages to users when mutations failerror-rollback - Use optimistic updates with rollback on error for better UXALWAYS pass plain objects to the SDK - NEVER use JSON.stringify():
// ✅ CORRECT - Plain object
await sdk.client.fetch("/store/reviews", {
method: "POST",
body: {
product_id: "prod_123",
rating: 5,
}
})
// ❌ WRONG - JSON.stringify breaks the request
await sdk.client.fetch("/store/reviews", {
method: "POST",
body: JSON.stringify({ // ❌ DON'T DO THIS!
product_id: "prod_123",
rating: 5,
})
})
Why this matters:
Before implementing, verify you're NOT doing these:
SDK Usage:
React Query:
Data Display:
Error Handling:
For detailed patterns and examples, load reference file:
references/frontend-integration.md - SDK usage, React Query patterns, API integration
The reference file contains:
Use this skill for (PRIMARY SOURCE):
Use MedusaDocs MCP server for (SECONDARY SOURCE):
Why skills come first:
⚠️ CRITICAL: ALWAYS use the Medusa JS SDK - NEVER use regular fetch()
When building features that span backend and frontend:
sdk.store.product.list())sdk.client.fetch("/store/my-route")Why the SDK is required:
x-publishable-api-key headerAuthorization and session headersSee building-with-medusa for backend API route patterns.
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
leonxlnx/taste-skill
sickn33/antigravity-awesome-skills
erichowens/some_claude_skills
building-storefronts is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Solid pick for teams standardizing on skills: building-storefronts is focused, and the summary matches what you get after install.
Keeps context tight: building-storefronts is the kind of skill you can hand to a new teammate without a long onboarding doc.
building-storefronts has been reliable in day-to-day use. Documentation quality is above average for community skills.
Keeps context tight: building-storefronts is the kind of skill you can hand to a new teammate without a long onboarding doc.
We added building-storefronts from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
building-storefronts fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Solid pick for teams standardizing on skills: building-storefronts is focused, and the summary matches what you get after install.
building-storefronts is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
building-storefronts has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 65