TikTok for Developers

Developer Docs

Last updated October 22, 2026

Sharing

Configure share content for the user's share action and report business events for ad model optimization.

TTMinis.share(callback, options)

Triggers a share action. This API does not open the TikTok share panel; it configures the share content that will be used when the user taps the share button. This is similar to the onCopyUrl pattern in other platforms.

Parameters

Field

Type

Description

Required

title

string

The share title.

Yes

desc

string

The share description.

No

imageUrl

string

The share image URL.

No

query

Record<string, unknown>

Custom share query parameters.

No

Callback parameters

Field

Type

Description

is_success

boolean

Whether the share setup succeeded.

error

object

Returned on failure.

Example

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

    console.log('share success');
  },
  {
    title: 'Short Drama',
    desc: 'Watch the latest episode now',
    imageUrl: 'https://example.com/share-cover.png',
    query: {
      episodeId: 'ep_1001',
      from: 'share_button',
    },
  },
);

TTMinis.reportEvent(options)

Reports a business event for ad model optimization. The reported events are used by the monetization platform to optimize ad targeting.

Parameters

Field

Type

Description

Required

eventName

string

The event name.

Yes

params

Record<string, any>

The event parameters.

Yes

callback

(result) => void

Callback invoked when the report completes.

No

Callback parameters

Field

Type

Description

isSuccess

boolean

Whether the report succeeded.

error

object

Returned on failure.

Example

TTMinis.reportEvent({
  eventName: 'drama_episode_play',
  params: {
    episodeId: 'ep_1001',
    position: 1,
  },
  callback: function (res) {
    console.log('reportEvent:', res);
  },
});
TikTok for Developers