Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temu SDK (Unofficial, US Sellers Only)

An unofficial TypeScript/JavaScript SDK for interacting with the Temu OpenAPI. This SDK helps you easily access Temu endpoints such as orders, products, logistics, fulfillment, ads, promotions, and more, without worrying about request signing or API boilerplate.

Note

⚠️ Important: This SDK currently supports only the US Temu OpenAPI endpoints. EU and Global endpoints are not implemented.

🚀 Installation

npm install temu-sdk
# or
yarn add temu-sdk
# or
pnpm add temu-sdk

⚡ Quick Start

import dotenv from 'dotenv'
import TemuClient from 'temu-sdk'

dotenv.config()

const temu = new TemuClient({
    appKey: process.env.APP_KEY,
    accessToken: process.env.ACCESS_TOKEN,
    appSecret: process.env.APP_SECRET,
});

// Example: fetch orders
(async () => {
  const orders = await temu.order.orderListV2Get({
    pageNumber: 1,
    pageSize: 100
  });
  console.log(orders);
})();

🔧 Configuration

Option Type Required Default Description
appKey string Your Temu app key
appSecret string Your Temu app secret
accessToken string Access token from Temu OAuth flow
baseurl string https://openapi-b-us.temu.com/openapi/router API base URL (change this if you’re using a proxy)
headers Record<string,string> {} Extra headers (e.g. custom proxy headers, x-make-apikey, debug headers)

📦 Example: Using with a Proxy

const temu = new TemuClient({
  appKey: "xxx",
  appSecret: "yyy",
  accessToken: "zzz",
  baseurl: "https://my-proxy.example.com/temu",
  headers: {
    "x-proxy-auth": "secret-token",
    "x-debug": "true",
  },
});

🔍 Available Endpoints

The SDK provides the following groups of methods:

  • client.ads
  • client.authorization
  • client.fulfillment
  • client.logistics
  • client.order
  • client.price
  • client.product
  • client.promotion
  • client.returnRefund
  • client.webhook

Each group exposes methods corresponding to Temu API operations. (See official Temu API docs for full method details.)

🛠 Advanced: Direct Request (Escape Hatch)

If an endpoint is not yet implemented, you can call the low-level method:

const result = await client._request("temu.custom.method", {
  param1: "value",
  param2: "value",
});

Warning

⚠️ Note: _request is considered internal. Use it at your own risk.

📜 License

MIT License. This project is not officially affiliated with Temu.

About

An unofficial Temu SDK for JavaScript/Node.js. This package supports only the US Temu OpenAPI (not EU or Global).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages