Docs
grovs.io Start for free

Link creation

Generate smart links programmatically in your web app.

javascript
const url = await Grovs.generateLink({
  title: "Check out this product",
  subtitle: "Limited time offer",
  imageURL: "https://example.com/image.jpg",
  data: { productId: "12345", screen: "product_detail" },
  tags: ["promotion", "share"],
  trackingCampaign: "spring_sale",
  trackingSource: "in_app",
  trackingMedium: "share_button",
});
 
if (url) {
  await navigator.share({ url });
}

generateLink resolves the URL string, or null on failure. Request failures reach onError as linkGenerationFailed. The SDK must be configured, authenticated and enabled:

  • Before authentication, it resolves null and reports once per page load.
  • While disabled, it resolves null silently.

Parameters

Every field is optional.

ParameterTypeDescription
titlestringLink preview title
subtitlestringLink preview subtitle
imageURLstringLink preview image URL
dataobjectCustom payload delivered when the link is opened. Must be JSON-serializable
tagsstring[]Tags for filtering and analytics
customRedirectsCustomRedirectsOverride the default redirect per platform. See Custom redirects
showPreviewiOSbooleanShow the link preview page on iOS. Omit to use the project default
showPreviewAndroidbooleanShow the link preview page on Android. Omit to use the project default
copyToClipboardiOSbooleanCopy the link to the clipboard from the iOS preview page, so the native SDK can match a fresh install. Omit to inherit the project setting
copyToClipboardAndroidbooleanSame, for Android
trackingCampaignstringCampaign name, for example "BlackFriday2025"
trackingSourcestringTraffic source, for example "instagram", "newsletter"
trackingMediumstringMedium, for example "cpc", "email", "social"

copyToClipboardiOS and copyToClipboardAndroid apply only when that platform shows the preview page. Passing false is an explicit override, unlike omitting the field. The web SDK never reads the clipboard: the preview page copies, and the iOS and Android SDKs read it back after install. Full flow: Copy to Clipboard.

Custom redirects

Override where a link sends users per platform:

javascript
const url = await Grovs.generateLink({
  title: "Special offer",
  data: { promoId: "summer25" },
  customRedirects: {
    ios: { link: "https://example.com/ios-promo" },
    android: { link: "https://example.com/android-promo" },
    desktop: { link: "https://example.com/desktop-promo" },
  },
});

For ios and android, an omitted openAppIfInstalled is sent as false, so the redirect URL is always used. Set true to open the app if installed, otherwise use the redirect URL. desktop has no such flag.

javascript
const details = await Grovs.linkDetails("abc123");

Resolves the record for a link the SDK generated in the current environment, by path, or null when the path is unknown.

Next steps

Last updated 2026-10-27
Was this page helpful?