Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@medusajs/medusa-js

Package Overview
Dependencies
Maintainers
2
Versions
837
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@medusajs/medusa-js

Client for Medusa Commerce Rest API

  • 1.0.1-next.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
decreased by-2.49%
Maintainers
2
Weekly downloads
 
Created
Source

Medusa Commerce JS SDK

Version

The Medusa Commerce JS SDK provides easy access to the Medusa Commerce API from clients written in JavaScript.

Documentation

See the our API reference.

Installation

Install the package with:

npm install @medusajs/medusa-js
# or
yarn add @medusajs/medusa-js

Usage

The SDK can be configured with a secret key from your store (Coming soon!).

Import Medusa as a default import and initiate it:

import Medusa from '@medusajs/medusa-js';

const medusa = new Medusa();

const { cart } = await medusa.carts.create({});

Configuration

Initialize with config object

The package can be initialized with several options:

const medusa = new Medusa({
  maxRetries: 3,
  baseUrl: 'https://api.example.com',
});
OptionDefaultDescription
maxRetries0The amount of times a request is retried.
baseUrl'http://localhost:9000'The url to which requests are made to
secretKeynullSecret key to use for authenticated routes

FAQs

Package last updated on 27 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc