Skip to main content

getTossShareLink

Generates a Toss in-app share link for the given path and optional OG image URL. Pass the returned link to share or copy it to the clipboard so other users can deep-link directly into a specific screen of the mini-app.

Signature

import { getTossShareLink } from '@apps-in-toss/web-framework';

declare function getTossShareLink(path: string, ogImageUrl?: string): Promise<string>;

Parameters

NameTypeRequiredDescription
pathstringThe mini-app path the recipient will land on (e.g. /products/123).
ogImageUrlstringOptional OG image URL used for link previews in messengers and SMS.

Returns

  • Promise<string> — the generated Toss in-app share link.
  • In the devtools mock, returns a placeholder of the form https://toss.im/share/mock<path>.

Permission

No permission required.

Examples

Minimal

import { getTossShareLink } from '@apps-in-toss/web-framework';

const link = await getTossShareLink('/products/123');
console.log(link);

Realistic — generate then share

import { getTossShareLink, share } from '@apps-in-toss/web-framework';

async function shareProduct(productId: string, ogImageUrl: string) {
const link = await getTossShareLink(`/products/${productId}`, ogImageUrl);
await share({ message: link });
}

Try it live

Open the Navigation page in sdk-example and run the getTossShareLink card.

Open in sdk-example
  • share — open the system share sheet with a message.
  • openURL — open an external URL.

External references