npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@amazon-sp-api-release/amazon-sp-api-sdk-js

v1.7.2

Published

This package is selling partner API Javascript SDK for nodeJS with LWA libraries.

Readme

JavaScript SDK for Selling Partner API

npm version

Video Thumbnail

Click on the image to watch the video.

The Selling Partner API SDK for JavaScript enables you to easily connect your JavaScript/Node.js application to Amazon's REST-based Selling Partner API.

Getting started

Credentials

Before you can use the SDK, you need to be registered as a Selling Partner API developer. If you haven't done that yet, please follow the instructions in the SP-API Registration Overview. You also need to register your application to get valid credentials to call SP-API. If you haven't done that yet, please follow the instructions in Registering your Application. If you are already registered successfully, you can find instructions on how to view your credentials in Viewing your Application Information and Credentials.

Minimum requirements

To run the SDK you need Node version 14 or higher.

Install the SDK

  1. Find the latest version number here.
  2. Add the dependency to your project (see instructions for npm, yarn and Add as an package dependency below).
Using npm:
npm install @amazon-sp-api-release/amazon-sp-api-sdk-js
Using yarn:
yarn add @amazon-sp-api-release/amazon-sp-api-sdk-js
Add as a package dependency

Add the following line to the dependencies in your package.json file:

"@amazon-sp-api-release/amazon-sp-api-sdk-js": "^1.0.0"

Use the SDK

In order to call one of the APIs included in the Selling Partner API, you need to:

  1. Configure credentials (Note: Use your individual credentials for clientId, clientSecret and refreshToken)
  2. Enable auto accessToken retrievel using our built in ApiClient function OR retrieve accessToken using our LwaAuthClient helper (Be aware for some APIs, you will need extra step to get RDT Token)
  3. Create an instance for a specific API and API client, then apply accessToken to it.
  4. Call an API operation

For an example, refer to the following sample code for connecting to Sellers API:

import {
  SellersSpApi
} from '@amazon-sp-api-release/amazon-sp-api-sdk-js';

async function getMarketplaceParticipations() {
  try {
      //Configure Sellers ApiClient
      const sellersApiClient = new SellersSpApi.ApiClient(AppConfig.spApiNAEndpoint);
      sellersApiClient.enableAutoRetrievalAccessToken('<YOUR_CLIENT_ID>','<YOUR_CLIENT_SECRET>', '<YOUR_REFRESH_TOKEN>', null);
      const sellersApi = new SellersSpApi.SellersApi(sellersApiClient);
      
      //Call GetMarkerplaceParticipations API
      const participations = await sellersApi.getMarketplaceParticipations();
      console.log(
        JSON.stringify(participations, null, ' ') + 
          '\n**********************************'
      )
  } catch (error) {
      console.error('Exception when calling getMarketplaceParticipations API', error.message);
  }
}

getMarketplaceParticipations();

Alternatively, you can go to @amazon-sp-api-release/amazon-sp-api-sdk-js/sample-node-app and copy over and modify index.js and app.config.mjs files and give them a try. You can see multiple API operation call samples with various way of retrieving token, as well how to set up rate limiter and retry logic when making API calls. Note that the rate limiter is turned on by default to protect your API calls from 429 errors.

Additional Note:

This Amazon Selling Partner API JavaScript SDK is fully compatible with ECMAScript modules (ESM). You can use modern ES6+ import/export syntax as demonstrated in the example code:

import {
  SellersSpApi,
} from '@amazon-sp-api-release/amazon-sp-api-sdk-js';

Giving Feedback

We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels:

Submit issues - this is the preferred channel to interact with our team Articulate your feature request or upvote existing ones on our Issues page