Publit.Si
Docs›Connect TikTok

Platforms

Connect TikTok

Until TikTok audits your app, posts through its API can only be private (Only me). So public video posts go through TikTok Studio: at the scheduled time Publit.Si opens the post's copy page, you download the video, copy the caption and post it in TikTok Studio yourself. With the optional Chrome extension, Publit.Si fills them in for you and you click Post.

You need

  • A Cloudflare tunnel
  • A TikTok account and a login for developers.tiktok.com
  • A 1024×1024 icon for the app (any image of yours)
  • A browser for TikTok Studio; Google Chrome only for the optional extension

Create the TikTok app and sandbox

  1. Open developers.tiktok.com → Manage apps → Connect an app, platform Web.

    TikTok for Developers, Manage apps with the Connect an app button and one app
    1. 1:Connect an app
    2. 2:Your app
    Manage apps → Connect an app (platform Web).
  2. Create a sandbox for the app. It needs the icon, a category and privacy and terms URLs: use https://publish.example.com/privacy and https://publish.example.com/terms. Your gateway serves them.

Add products and scopes

  1. Switch to Sandbox → Products → Add products: Login Kit and Content Posting API (turn on Direct Post). Only for statistics also Display API.

    TikTok app in Sandbox, Products: Login Kit with a redirect URI and Content Posting API with Direct Post switched on
    1. 1:Sandbox
    2. 2:Login Kit
    3. 3:Content Posting API
    4. 4:Direct Post
    Sandbox → Products: Login Kit and Content Posting API with Direct Post on. Display API only for statistics.
  2. Scopes: user.info.basic, user.info.profile, video.upload, video.publish. For statistics (TIKTOK_ANALYTICS=1) also user.info.stats and video.list; video.list comes with Display API.

    TikTok app scopes: user.info.basic, video.publish, video.upload and two more user info scopes
    1. 1:user.info.basic
    2. 2:video.publish
    3. 3:video.upload
    Scopes: Publit.Si needs these three. For statistics also user.info.stats and video.list (Display API).

Set the redirect URI and test user

  1. Copy the redirect URI from Publit.Si › Settings › Platform setup › TikTok, e.g. https://publish.example.com/oauth/tiktok/callback. Login Kit → Redirect URI → Web → paste it.

    Login Kit with the Web tab and the redirect URI of the tunnel
    1. 1:Web
    2. 2:Redirect URI
    Login Kit → Web → the redirect URI from Publit.Si.
  2. Sandbox settings → Target Users → Add account: your TikTok account.

    TikTok Sandbox settings, Target Users with the Add account button and two added accounts
    1. 1:Sandbox settings
    2. 2:Add account
    Sandbox settings → Target Users → Add account: your TikTok account.
  3. Click Apply changes (top right). Sandbox changes only count after that.

  4. Photo posts only: under URL properties, verify your tunnel domain with the DNS TXT record TikTok shows (add it in Cloudflare → DNS).

Enter the keys

  1. Copy the sandbox Client key and Client secret into Publit.Si under Enter credentials, or .env:

    TIKTOK_CLIENT_KEY=…
    TIKTOK_CLIENT_SECRET=…
    TIKTOK_ANALYTICS=1   # if you added the statistics scopes
    Enter credentials form in Publit.Si with the Google client ID filled in and the secret field empty
    1. 1:Client ID
    2. 2:Save and apply
    Enter credentials writes the keys into .env for you and restarts the services. Secrets are never shown again.
Optional

Install the Chrome extension

Only if you want TikTok Studio filled in for you. Do this once in every Chrome profile you use for TikTok.

  1. Open chrome://extensions and switch on Developer mode (top right).

  2. Load unpacked → choose the extension/ folder in your publitsi folder.

    chrome://extensions with Developer mode on, the Load unpacked button and the Publit.Si Helper card
    1. 1:Developer mode
    2. 2:Load unpacked
    3. 3:Publit.Si Helper
    chrome://extensions → Developer mode on → Load unpacked → the extension/ folder.
  3. Chrome shows a notice about developer-mode extensions. That's normal for extensions you load yourself.

  4. Publit.Si → Accounts → open the TikTok account → turn on Chrome extension and confirm the warning.

Check

Settings › Platform setup › TikTok shows every item as set. With the extension: it appears in chrome://extensions in each TikTok profile and is turned on for the account.

Troubleshooting

redirect_uri_mismatch
The redirect URI in the dashboard must match exactly, including http/https and port.
TikTok rejects the login with a scope error
The statistics scopes aren't enabled. Switch off TikTok: statistics under Settings › Platforms › Statistics and comments (or set TIKTOK_ANALYTICS=0 and restart), then reconnect.
TikTok post never gets marked as published
By default, confirm "It’s online" on the copy page or in the queue after posting yourself. With the optional extension, check it is installed in the right Chrome profile and turned on for this account; confirm "It’s online" yourself if needed.

Stuck? Search the troubleshooting list or write to us . Leave out secrets and tokens.