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

ae_sdk

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ae_sdk

A simple SDK for Aliexpress (dropshipping and affiliate) APIs.

  • 0.4.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-65.22%
Maintainers
1
Weekly downloads
 
Created
Source

Aliexpress SDK npm version

Typescript CI Publish Downloads Bundle Size License

A simple and type-safe SDK for Aliexpress (system tools, dropshipping and affiliate) APIs.

Overview

Aliexpress launched a new open platform to consume their APIs. They fully migrated and upgraded their services from the old Taobao Open Platform to the new Open Platform for International Developers. The issue is, with this update, they have yet to release a Node.js SDK.

Features

This library is an unofficial and simple SDK that can do the following:

  • Compose a request, generate an encryption (method signature) and interprete the response.
  • Pass the right parameters for your API call with type safe methods.
  • Currently supports the system tools for authentication, Affiliate API and Dropshipping API.

Installation

# using npm
npm i ae_sdk

# using pnpm
pnpm add ae_sdk

# using yarn
yarn add ae_sdk

Usage

To be able to use this SDK, you must first become a developer, follow the steps to register an application, to then retrive your app_key and app_secret.

Lastly an access token is required to access the API, follow the steps for the authorization process described in this link. When you get your access token, make sure to pass it the client initialization as session.

// step 1: import the AE affiliate (`AffiliateClient`) or dropshipping (`DropshipperClient`) client
import { DropshipperClient /* AffiliateClient */ } from "ae_sdk";

// step 2: initilize the client
const client = new DropshipperClient({
  app_key: "123",
  app_secret: "123456abcdef", // process.env.AE_DS_APP_SECRET
  session: "oauth_access_token", // process.env.AE_DS_ACCESS_TOKEN or fetch from DB
});

// step 3: you are all set !
const result = await client.productDetails({
  product_id: 1005004043442825,
  ship_to_country: "DZ",
  target_currency: "USD",
  target_language: "en",
});

console.log(result);

If the call was successfull, you will get back the following results.

Inside the data object is the API response.

{
  ok: true,
  data: {
    aliexpress_ds_product_get_response: {
      result: {...},
      rsp_code: 200,
      rsp_msg: "Call succeeds",
      request_id: "..."
    }
  }
}

Else if an error occured you will receive the following:

Make sure you to pass the right parameters, but if the problem persits, please contact me

{
  ok: false,
  message: "..."
}

Directly call the API

If you wish to call a different Aliexpress API that is not by the current version. You can do the following:

const result = await client.callAPIDirectly("aliexpress.api.endpoint", {
  [string]: string | number | boolean,
});

Todos

  • Add file parameter to pass bytes[] as a method argument, example: query product using an image.
  • Add unit tests.
  • Write documentation.

Keywords

FAQs

Package last updated on 17 Sep 2023

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