Skip to content

TypeScript SDK

Install tiktok-shop-api, the typed TikTok Shop API client for TypeScript and Node.js, and make your first call.

tiktok-shop-api is a typed TypeScript and Node.js client for the TikTok Shop Partner API. It signs requests, handles OAuth, works with many shops at once, and verifies and types webhooks. It is published to npm, and its source is in typescript/.

Terminal window
npm install tiktok-shop-api

Requires Node.js 22 or newer. The package is ESM-only and has no runtime dependencies.

With an access token from the OAuth helper, create a client, look up the shop cipher, and call an operation on that shop:

import { TikTokShop } from 'tiktok-shop-api';
const client = new TikTokShop({
appKey: process.env.TTS_APP_KEY!,
appSecret: process.env.TTS_APP_SECRET!,
accessToken: tokens.accessToken,
});
// Find the shop cipher
const shops = await client.authorization.getAuthorizedShops();
const shopCipher = shops.data?.shops?.[0]?.cipher;
const seller = client.withShop({ accessToken: tokens.accessToken, shopCipher });
const orders = await seller.orders.getOrderList({ pageSize: 20 });

Every call is signed, timestamped and sent with your access token. The shop_cipher query parameter is added for you on the endpoints that need it.

  • Authorization: TikTokShopAuth, authorization URLs, token exchange and refresh.
  • Calling the API: the client, API areas, many shops, 64-bit IDs and options.
  • Webhooks: Webhooks.verifyAndParse and typed events.
  • Errors: TikTokShopError and its codes.