Skip to main content

SDK Methods

The Medusa JavaScript SDK provides a comprehensive set of methods organized by domain. This guide covers the core patterns, client usage, and available methods.

Client Architecture

The SDK is structured around four main namespaces:

Method Patterns

All SDK methods follow consistent patterns:

Standard CRUD Methods

Most resources support these standard operations:

Query Parameters

All list and retrieve methods support query parameters:
object

Custom Headers

Pass headers to individual requests:

Admin API Methods

The admin namespace provides access to all administrative operations.

Product Management

Product Variants

Order Management

Customer Management

Inventory Management

Region & Currency

Store API Methods

The store namespace provides customer-facing operations.

Product Browsing

Cart Management

Checkout Flow

Customer Account

Authentication Methods

The auth namespace handles authentication flows.

Customer Registration & Login

Admin User Login

OAuth / Third-Party Login

Password Reset

Logout

Low-Level Client

The client property provides direct access to the HTTP client.

Custom Requests

Server-Sent Events (SSE)

Locale Management

Token Management

Error Handling

Handle errors using try-catch with FetchError:

TypeScript Support

The SDK is fully typed using types from @medusajs/types:

Next Steps

Overview

Learn about SDK features and use cases

API Reference

Explore complete API documentation