Skip to content

Create links in your app

Use client-created links when a user wants to share app content that is only available on the device or does not need a server round trip.

This capability is disabled by default. Enable client-side link creation in the Ferry project before calling it.

iOS

let link = try await Ferry.createLink(
domain: "go.acme.com",
data: ["screen": "profile", "user_id": "u_42"]
)
share(link.url)

Android

Ferry.createLink(
"go.acme.com",
mapOf("screen" to "profile", "user_id" to "u_42")
) { result ->
when (result) {
is FerryCreateLinkResult.Success -> share(result.link.url)
is FerryCreateLinkResult.Failure -> report(result.error)
}
}

Flutter

final link = await Ferry.createLink(
domain: 'go.acme.com',
data: {'screen': 'profile', 'user_id': 'u_42'},
);
share(link.url);

React Native

const link = await Ferry.createLink('go.acme.com', {
screen: 'profile',
user_id: 'u_42',
});
share(link.url);

The domain must exactly match an active hostname assigned to the same Ferry project as the SDK’s pk_ key.

Deliberate limits

Client-created links:

  • Carry a data-only payload.
  • Cannot select a redirect URL.
  • Cannot set campaign fields.
  • Receive a server-generated slug.
  • Expire after seven days unless promoted through the control plane.
  • Are rate limited to 5 per hour and 10 per day for one installation.

These limits keep a public-key capability suitable for an app bundle.

Handle failures

Link creation is the one SDK operation that reports failures directly because the user is waiting for a shareable URL.

Handle at least:

  • Link creation disabled: Do not retry. Enable it for the project or use a server-created link.
  • Rate limited: Respect the returned retry interval.
  • Invalid domain: Use an active hostname assigned to the project.
  • Transport failure: Offer retry or a non-link sharing fallback.

If many shares use the same route, create one template link and add data as query parameters. Template links avoid client link limits and do not require an SDK creation call.