Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiktok-shop

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiktok-shop

More detail: https://partner.tiktokshop.com/doc

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
decreased by-32%
Maintainers
1
Weekly downloads
 
Created
Source

Tiktok-shop Logo

Generate "signature" and "token" for Tiktok Shop.

NPM Version

I am very happy and grateful for everyone's help. These meaningful contributions will greatly help me in expanding the useful library to help people.

Buy Me A Coffee

Paypal: https://paypal.me/tudinhacoustic

Content

  1. Installation
  2. Features
  3. Community
  4. Generate Signature
  5. Generate Token using Auth Code
  6. Generate Token using Refresh Token

Installation

Installation is done using the npm install command:

$ npm install tiktok-shop

Back

Features

  • Generate Signature
  • Generate Token using Auth Code
  • Generate Token using Refresh Token

Back

Community

Back

Generate Signature

const tiktokShop = require('tiktok-shop')

// Extract all query param EXCEPT ' sign ', ' access_token ', You do not need to reorder the params based on alphabetical order.
const config = {
    app_key: 'yourAppKey', // Required
    app_secret: 'yourAppSecret',  // Required
    shop_id: 'yourShopId', // Optional
    shop_cipher: 'yourShopCipher', // Optional
    version: '202306', // Default: 202212
}

// Tiktok API name, more detail: https://partner.tiktokshop.com/dev/api-testing-tool
const path = '/api/orders/search';
const signature = tiktokShop.signature(config, path);
console.info(signature);

Response Data

{
  signature: '96f15922fbacd220cea0d8370ba7dff2273674f2a2856868b7e32f7d98da0efe',
  timestamp: 1697540200
}

Back

Generate Token using Auth Code

const tiktokShop = require('tiktok-shop')

// Extract all query param EXCEPT ' sign ', ' access_token ', You do not need to reorder the params based on alphabetical order.
const config = {
    app_key: 'yourAppKey', // Required
    app_secret: 'yourAppSecret',  // Required
}

// How to get Auth Code: https://partner.tiktokshop.com/doc/page/63fd743c715d622a338c4e5a
const authCode = 'yourAuthCode';
const accessToken = tiktokShop.authCodeToken(config, authCode);
console.info(accessToken);

Response Data

{
    "access_token": "ROW_-3_uKAAAAADYdCab***",
    "access_token_expire_in": 1696992654,
    "refresh_token": "ROW_RBHCjwAAAACgH1O***",
    "refresh_token_expire_in": 4818450857,
    "open_id": "D3MazQAAAAAi5AmxAvxkSaBRs***",
    "seller_name": "Test",
    "seller_base_region": "VN",
    "user_type": 0
}

Back

Generate Token using Refresh Token

const tiktokShop = require('tiktok-shop')

// Extract all query param EXCEPT ' sign ', ' access_token ', You do not need to reorder the params based on alphabetical order.
const config = {
    app_key: 'yourAppKey', // Required
    app_secret: 'yourAppSecret',  // Required
}

// How to get Auth Code: https://partner.tiktokshop.com/doc/page/63fd743c715d622a338c4e5a
const refreshToken = 'yourRefreshToken';
const accessToken = tiktokShop.authCodeToken(config, refreshToken);
console.info(accessToken);

Response Data

{
    "access_token": "ROW_-3_uKAAAAADYdCab***",
    "access_token_expire_in": 1696992654,
    "refresh_token": "ROW_RBHCjwAAAACgH1O***",
    "refresh_token_expire_in": 4818450857,
    "open_id": "D3MazQAAAAAi5AmxAvxkSaBRs***",
    "seller_name": "Test",
    "seller_base_region": "VN",
    "user_type": 0
}

Back

Follow me on: Linkedin | Youtube | Facebook

Keywords

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc