TikTok for Developers

Developer Docs

Last updated October 22, 2026

Login and Authorization

These APIs manage the user's login status and data permissions.

TTMinis.login(callback)

Engages silent login initiating the login flow and obtaining the login authorization code. This attempts to log the user in and get their basic access credentials (code) without showing an authorization screen. Used for IAP and basic identification.

Callback parameters

Field

Type

Description

authResponse.code

string

The authorization code returned by login.

error

object

Returned on failure. See error structure.

Example

TTMinis.login(function (res) {
  if (res.error) {
    console.error('login failed', res.error);
    return;
  }

  console.log('login code:', res.authResponse.code);
});

TTMinis.authorize(callback, options)

Requests user authorization. Engages the explicit authorization process, which prompts the user with an authorization screen to grant your app specific data permissions. This is needed for data beyond basic ID, like username and avatar.

By default, calling TTMinis attempts to verify the user's basic permissions (avatar, display name, open ID, and union ID).

If you need one or more additional permissions, use the scope parameter, call TTMinis login, and set the scope parameter with a comma-separated list of permissions.

  • For account binding, please apply for this scope on the Developer Portal: user.info.basic - Login Kit.

Parameters

Field

Type

Description

Required

scope

string

The authorization scope. Default: user.info.basic.

No

returnScopes

boolean

Whether to include granted scopes in the response.

No

Callback parameters

Field

Type

Description

authResponse.code

string

The authorization code.

authResponse.grantedScopes

string

The actual granted scopes. Available when returnScopes is enabled.

error

object

Returned on failure.

Example

TTMinis.authorize(
  function (res) {
    if (res.error) {
      console.error('authorize failed', res.error);
      return;
    }

    console.log('auth code:', res.authResponse.code);
    console.log('granted scopes:', res.authResponse.grantedScopes);
  },
  {
    scope: 'user.info.basic',
    returnScopes: true,
  },
);
TikTok for Developers