Native sharing

Open the device's native share sheet to share text, images, video, files, or an Instagram Story.

Open the share sheet

Hand content to the device's native share sheet so the user can send it to another app like Messages, Mail, or Instagram. There is no result event — the call resolves once the sheet is requested, not when the user completes or cancels the share.

When not running in the app, the call doesn't run — triggered is false (pending in a browser tab, skipped with no window).

const bdk = createBdkNative();

// Each method dispatches and forgets — await confirms the sheet was requested.
await bdk.share.text({ text: "Check out this app!" });

Share text

Share a string of text, with an optional url or title. Use it for "Share this link" and "Tell a friend" flows.

const bdk = createBdkNative();

await bdk.share.text({
  text: "Check out this app!",
  url: "https://example.com"
});

Share an image

Share a hosted image by URL. Pass a bare string, not an object.

A protocol-relative URL beginning with // is upgraded to https://.

const bdk = createBdkNative();

await bdk.share.image("https://example.com/photos/sunset.jpg");

Share a video

Share a video by URL. Pass a bare string.

const bdk = createBdkNative();

await bdk.share.video("https://example.com/clips/demo.mp4");

Share a file

Share any file by URL — a PDF, a document, a download. Pass a bare string.

const bdk = createBdkNative();

await bdk.share.file("https://example.com/docs/invoice.pdf");

Share to an Instagram Story

Open content directly in the Instagram Stories composer for a one-tap "Share to your Story" button.

const bdk = createBdkNative();

await bdk.share.instagramStory({
  background_image_url: "https://example.com/story-bg.jpg",
  sticker_image_url: "https://example.com/sticker.png"
});

Check the result

Each method resolves a NativeCommandResult. Inspect triggered and skipped to confirm the share sheet opened — there is no event reporting whether the user finished the share.

const bdk = createBdkNative();

const result = await bdk.share.image("https://example.com/photo.jpg");
console.log(result.command);   // "shareImage"
console.log(result.triggered); // true if it reached the app
console.log(result.skipped);   // true if skipped (e.g. unsupported version)