building-storefronts

Installation
Summary

SDK-first frontend integration for Medusa storefronts with React Query patterns and critical API calling rules.

  • 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 requests, invalidating queries in onSuccess callbacks to refresh data after mutations
  • Prices from Medusa are stored as-is ($49.99 = 49.99, not in cents)—display them directly without dividing by 100
  • Load the reference file (references/frontend-integration.md) before implementing storefront features for complete SDK patterns, React Query examples, and error handling strategies
SKILL.md

Medusa Storefront Development

Frontend integration guide for building storefronts with Medusa. Covers SDK usage, React Query patterns, and calling custom API routes.

When to Apply

Load this skill for ANY storefront development task, including:

  • Calling custom Medusa API routes from the storefront
  • Integrating Medusa SDK in frontend applications
  • Using React Query for data fetching
  • Implementing mutations with optimistic updates
  • Error handling and cache invalidation

Also load building-with-medusa when: Building the backend API routes that the storefront calls

CRITICAL: Load Reference Files When Needed

The quick reference below is NOT sufficient for implementation. You MUST load the reference file before writing storefront integration code.

Related skills

More from medusajs/medusa-agent-skills

Installs
1.6K
GitHub Stars
162
First Seen
Jan 26, 2026