
Security News
November CVEs Fell 25% YoY, Driven by Slowdowns at Major CNAs
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.
tiktok-shop-sdk
Advanced tools
An unofficial, community-driven SDK built with TypeScript, designed to simplify integration with the TikTok Shop API for Node.js environments. This library provides a convenient, type-safe, and modern JavaScript-friendly way to interact with various TikTok Shop functionalities programmatically.
Leverage the power of TypeScript for robust development, including static typing, autocompletion (IntelliSense), and compile-time checks, reducing runtime errors and improving developer experience.
Whether you're looking to automate product listings, streamline order management, synchronize inventory, or build custom e-commerce solutions on top of TikTok Shop, this SDK aims to reduce boilerplate code and allow you to focus on your application's core logic.
This is an unofficial SDK. It is not affiliated with, endorsed, or sponsored by TikTok or ByteDance. The TikTok Shop API endpoints, request/response structures, and policies may change over time, which could impact the functionality of this SDK. While we strive to keep it updated, always refer to the Official TikTok Shop API Documentation (or the relevant official link) for the most authoritative and up-to-date information.
Before you begin, ensure you have the following set up:
Node.js: It's recommended to use an active LTS (Long Term Support) version of Node.js. This SDK is tested and compatible with:
Node.js >= 18.x (LTS)npm: The Node Package Manager is included with Node.js.
npm >= 8.xYou can check your versions by running node -v and npm -v in your terminal.
TikTok Shop Developer Account & App:
App Key and App Secret.npm install tiktok-shop-sdk
or with Yarn:
yarn add tiktok-shop-sdk
Please refer to the apps/examples/ directory in this repository. Each file in that folder demonstrates a specific feature or workflow.
import { TikTokShopSDK } from 'tiktok-shop-sdk';
// Initialize SDK with your app key and secret
const sdk = new TikTokShopSDK({
appKey: "", // Your TikTok Shop App Key
appSecret: "" // Your TikTok Shop App Secret
});
async function main() {
// Example 1: Request an access token using authorization code grant
// This step is necessary to obtain a valid access token for authenticated API calls
const response = await sdk.auth.getAccessToken({
auth_code: "", // Authorization code obtained from TikTok (must be provided)
grant_type: "authorized_code" // Grant type, typically fixed as "authorized_code"
});
console.log('Access Token Response:', response);
// Example 2: Use Access Token and Shop Cipher to update a webhook
// Before making API calls that require authorization, set the access token and shop cipher
// Set Access Token - typically stored in environment variables
sdk.setAccessToken(process.env.TIKTOK_APP_ACCESS_KEY!);
// Set Shop Cipher - also typically stored in environment variables
sdk.setShopCipher(process.env.TIKTOK_SHOP_CIPHER!);
// Update shop webhook configuration with new webhook URL and event type
const updateResponse = await sdk.event.updateShopWebhook({
address: "https://urlhere.com/notify",
event_type: "NEW_CONVERSATION"
});
console.log(updateResponse);
}
The SDK provides built-in error forwarding. You can catch API-related errors using standard try/catch blocks. Each error contains useful debugging information such as HTTP status, message, and optional TikTok API error codes (if returned).
Example
import { TikTokShopSDK, TikTokAPIError } from 'tiktok-shop-sdk';
const sdk = new TikTokShopSDK({
appKey: "",
appSecret: ""
});
try {
const response = await sdk.auth.refreshAccessToken({
refresh_token: process.env.TIKTOK_REFFRESH_TOKEN!,
grant_type: "refresh_token"
});
console.log(response)
} catch (error) {
if (error instanceof TikTokAPIError) {
console.error("TikTok API Error:", error.message);
console.error("Status Code:", error.code);
console.log("Request Id: ", error.requestId)
} else {
console.error("Unexpected error:", error);
}
}
To make authenticated API requests on behalf of a TikTok Shop seller, you must set the following credentials in your SDK instance:
setAccessToken(token: string)Sets the access token for all subsequent API calls. This token is obtained via the OAuth 2.0 authorization process.
sdk.setAccessToken("your_access_token_here");
setShopCipher(cipher: string)Sets the shop cipher (unique shop ID) required by most endpoints.
sdk.setShopCipher("your_shop_cipher_here");
⚠️ Call
setAccessTokenandsetShopCipherafter you obtain valid credentials — usually right after the OAuth process completes. You only need to call them once per session.
To run tests, run the following command
npm run test
Contributions are welcome! Please open an issue or pull request to discuss improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A TypeScript SDK for interacting with TikTok Shop OpenAPI.
We found that tiktok-shop-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.