WarpLink
SDKsReact Native

API Reference

Complete TypeScript API reference for the WarpLink React Native SDK.

The main entry point. Exported from @warplink/react-native.

import { WarpLink } from '@warplink/react-native';

configure(options)

configure(options: WarpLinkConfig): void

Initialize the SDK. Synchronous — validates key format locally, delegates async validation to native SDK.

ParameterTypeDescription
optionsWarpLinkConfigConfiguration with API key and optional settings.

Throws: WarpLinkError with code E_INVALID_API_KEY_FORMAT if the key is invalid.

handleDeepLink(url)

handleDeepLink(url: string): Promise<WarpLinkDeepLink | null>

Resolve a deep link URL to its link data.

Errors: E_NOT_CONFIGURED, E_INVALID_URL, E_LINK_NOT_FOUND, E_NETWORK_ERROR, E_SERVER_ERROR, E_INVALID_API_KEY, E_DECODING_ERROR

checkDeferredDeepLink(): Promise<WarpLinkDeepLink | null>

Check for a deferred deep link on first launch. Returns null on subsequent launches (cached).

Errors: E_NOT_CONFIGURED, E_NETWORK_ERROR, E_SERVER_ERROR, E_INVALID_API_KEY, E_DECODING_ERROR

getAttributionResult()

getAttributionResult(): Promise<AttributionResult | null>

Get install attribution data. Returns null if no attribution match found.

isConfigured()

isConfigured(): Promise<boolean>

Check whether the SDK has been configured.

onDeepLink(listener)

onDeepLink(listener: DeepLinkListener): () => void

Register a listener for warm-start deep link events. Returns an unsubscribe function.

getInitialDeepLink(): Promise<WarpLinkDeepLink | null>

Get the deep link that launched the app (cold start). Returns null if not launched via a link.


Types

WarpLinkConfig

interface WarpLinkConfig {
  apiKey: string;
  apiEndpoint?: string;     // Default: "https://api.warplink.app/v1"
  debugLogging?: boolean;   // Default: false
  matchWindowHours?: number; // Default: 72
}
interface WarpLinkDeepLink {
  linkId: string;
  destination: string;
  deepLinkUrl: string | null;
  customParams: Record<string, unknown>;
  isDeferred: boolean;
  matchType: 'deterministic' | 'probabilistic' | null;
  matchConfidence: number | null;
}

AttributionResult

interface AttributionResult {
  linkId: string;
  matchType: 'deterministic' | 'probabilistic';
  matchConfidence: number;
  isDeferred: boolean;
  installId: string | null;
}

DeepLinkEvent

Discriminated union — exactly one of deepLink or error is present.

type DeepLinkEvent =
  | { deepLink: WarpLinkDeepLink; error?: undefined }
  | { deepLink?: undefined; error: WarpLinkError };

DeepLinkListener

type DeepLinkListener = (event: DeepLinkEvent) => void;

Error Types

WarpLinkError

class WarpLinkError extends Error {
  readonly code: ErrorCode;
  constructor(code: ErrorCode, message: string);
}

ErrorCodes

const ErrorCodes = {
  E_NOT_CONFIGURED: 'E_NOT_CONFIGURED',
  E_INVALID_API_KEY_FORMAT: 'E_INVALID_API_KEY_FORMAT',
  E_INVALID_API_KEY: 'E_INVALID_API_KEY',
  E_NETWORK_ERROR: 'E_NETWORK_ERROR',
  E_SERVER_ERROR: 'E_SERVER_ERROR',
  E_INVALID_URL: 'E_INVALID_URL',
  E_LINK_NOT_FOUND: 'E_LINK_NOT_FOUND',
  E_DECODING_ERROR: 'E_DECODING_ERROR',
} as const;
CodeDescription
E_NOT_CONFIGUREDSDK not initialized.
E_INVALID_API_KEY_FORMATKey format invalid.
E_INVALID_API_KEYKey rejected by server.
E_NETWORK_ERRORNetwork unreachable or timeout.
E_SERVER_ERRORServer returned 5xx.
E_INVALID_URLNot a recognized WarpLink domain.
E_LINK_NOT_FOUNDLink not found or inactive.
E_DECODING_ERRORMalformed server response.

On this page