React Native SDK reference
Read the React Native setup tutorial first. This page lists the available functions from @li-nk.me/react-native-sdk.
Package: @li-nk.me/react-native-sdk
Imports
import {
configure,
getInitialLink,
handleUrl,
onLink,
claimDeferredIfAvailable,
track,
setUserId,
setAdvertisingConsent,
setReady,
LinkMePayload,
} from '@li-nk.me/react-native-sdk';
Payload shape
| Field | Type | Notes |
|---|---|---|
path |
string | undefined |
Deep-link path (/screen/123). |
params |
Record<string, string> | undefined |
Query parameters. |
utm |
Record<string, string> | undefined |
Normalized UTM values. |
custom |
Record<string, string> | undefined |
Custom metadata saved with the link. |
linkId |
string | undefined |
Unique short link ID. |
url |
string | undefined |
Original universal link URL, when available. |
isLinkMe |
boolean | undefined |
true for LinkMe-resolved links, false for basic universal link fallbacks. |
cid |
string | undefined |
Click identifier used for resolution. |
Functions
configure(options)
Initializes the singleton. Returns a promise.
| Option | Type | Description |
|---|---|---|
appId |
string |
Required. |
appKey |
string |
Optional read-only key. |
sendDeviceInfo |
boolean |
Default true. Include device metadata. |
includeVendorId |
boolean |
iOS vendor identifier. |
includeAdvertisingId |
boolean |
Leave false until consent granted. |
debug |
boolean |
Default false. When true, the SDK logs pasteboard checks and deferred claim responses to Metro/Xcode/Logcat for troubleshooting. |
getInitialLink()
Resolves with the payload that opened the app (if any).
const initial = await getInitialLink();
if (initial?.path) router.replace(initial.path);
handleUrl(url: string)
Manually process a URL. Returns Promise<boolean> indicating whether a payload was resolved.
claimDeferredIfAvailable()
Returns a deferred payload for first installs. Android uses the Play Install Referrer; iOS uses pasteboard (if expo-clipboard is installed) before falling back to fingerprint matching.
onLink(callback)
Subscribes to future payloads. Returns { remove: () => void }.
const sub = onLink((payload) => payload?.path && router.replace(payload.path));
sub.remove();
track(event, properties?)
Sends analytics events.
await track('open');
await track('signup', { method: 'email' });
setUserId(userId)
Associates a user identifier with future events.
setAdvertisingConsent(granted)
Toggles whether advertising identifiers are sent.
setReady()
Signals readiness to process queued URLs. Call after consent dialogs or other async setup.
Optional class API
import LinkMeClient from '@li-nk.me/react-native-sdk';
const client = new LinkMeClient();
await client.configure({ appId: 'app_123' });
const initial = await client.getInitialLink();
const sub = client.onLink(() => {});
sub.remove();
Use this form if you want multiple instances (e.g., tests or dependency injection).