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
npm install temu-sdk
# or
yarn add temu-sdk
# or
pnpm add temu-sdkimport 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);
})();| 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) |
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",
},
});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.)
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
MIT License. This project is not officially affiliated with Temu.