@redonvn/skd-tiktok-shop
v1.0.0
Published
SDK for TikTok Shop
Keywords
Readme
Node.js SDK
Prerequisites
Before integrating TikTok Shop API SDK into your project and making your first API call with the SDK, you must create a test seller account and generate a test access token.
Integrate Node.js SDK
Online version of this document: [https://partner.tiktokshop.com/docv2/page/67c83e0799a75104986ae498](Tiktok Shop API SDK)
Prerequisites
Ensure your project meets all of the following conditions:
- Node.js 16+
Installation
Refer to the following steps to integrate the SDK into your project.
- Add the unzipped folder to your project directory.
- Configure dependencies in
package.json:
{
"dependencies": {
"request":"2.88.2"
},
"devDependencies": {
"@types/request":"2.48.12",
"@types/node": "16",
"tslib":"2.6.2",
"typescript": "^4.9.5",
}
}- Add the following to your
tsconfig.jsonfile:
{
"esModuleInterop": true,
}- Install dependencies using your preferred package manager:
// npm
npm install
// yarn
yarn install
// pnpm
pnpm iInitialize API request instance
import { ClientConfiguration, TikTokShopNodeApiClient,AccessTokenTool } from ".";
ClientConfiguration.globalConfig.app_key = "XXXXXXXXX";
ClientConfiguration.globalConfig.app_secret =
"XXXXXXXXX";
const access_token = "XXXXXXXXX"
const client = new TikTokShopNodeApiClient({
config: {
sandbox: false,
},
}); Make API Requests and Access API Response
const main = async () => {
const result = await client.api.ProductV202502Api.ProductsSearchPost(1,access_token,'application/json',undefined,undefined);
console.log('resp data := ',JSON.stringify(result.body, null, 2));
};
main(); 