TikTok for Developers

Docs

Share

share(cb,opts)

TTMinis.share() needs to be used in conjunction with TTMinis.on('minis.share', callback). TikTok Minis Link is generated by listening to the minis.share message (triggered by the user on the client) and executing TTMinis.share() in the message processing callback.

Callback

interface CallbackResult {
  is_success: boolean;
  error?: MinisError;
}

type Callback = (result: CallbackResult) => void;

Options

interface Options {
  title: string;
  desc?: string;
  imageUrl?: string;
  query?: Record<string, unknown>;
}

Example

TTMinis.on('minis.share', () => {
  TTMinis.share(()=>{
    //
  }, {
    title: "title of the current page",
    desc: "description of the current page",
    imageUrl: "image link of the current page",
    query: "query parameters of the current page route"
  })
})


Was this document helpful?
TikTok for Developers