Skip to content

WarpLinkApp/warplink-react-native-sdk

Repository files navigation

@warplink/react-native

License: MIT npm version CI

Deep linking SDK for React Native — handle Universal Links and App Links, resolve deferred deep links, and attribute installs with WarpLink.

Requirements

Requirement Minimum Version
React Native >= 0.75.0
React >= 18.0.0
iOS 15+
Android API 26+ (Android 8.0)
Node.js 18+

Installation

Bare React Native

npm install @warplink/react-native

Then install iOS pods:

cd ios && pod install

Android auto-links via React Native CLI — no additional setup required.

Expo Managed Workflow

npx expo install @warplink/react-native

Then generate native projects:

npx expo prebuild

Note: This SDK requires native modules and does not work with Expo Go. You must use a development build (npx expo prebuild or EAS Build).

Quick Start

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

// Initialize on app startup (outside component — runs once)
WarpLink.configure({ apiKey: 'wl_live_abcdefghijklmnopqrstuvwxyz012345' });

function App() {
  useEffect(() => {
    // Handle warm-start deep links
    const unsubscribe = WarpLink.onDeepLink((event) => {
      if (event.deepLink) {
        console.log('Deep link destination:', event.deepLink.destination);
        // Navigate to event.deepLink.destination
      } else if (event.error) {
        console.error('Deep link error:', event.error.message);
      }
    });

    // Handle cold-start deep link
    WarpLink.getInitialDeepLink().then((link) => {
      if (link) {
        console.log('Cold start deep link:', link.destination);
        // Navigate to link.destination
      }
    });

    // Check for deferred deep link (first launch after install)
    WarpLink.checkDeferredDeepLink().then((link) => {
      if (link?.isDeferred) {
        console.log('Deferred deep link:', link.destination);
        // Navigate to link.deepLinkUrl ?? link.destination
      }
    });

    return unsubscribe;
  }, []);

  return <>{/* Your app */}</>;
}

Features

  • Universal Link & App Link Handling — resolve incoming deep links to destinations and custom parameters. See the Integration Guide.
  • Deferred Deep Links — route users to specific content even after App Store or Play Store install. See Deferred Deep Links.
  • Install Attribution — deterministic and probabilistic matching with confidence scores. See Attribution.
  • Cross-Platform — single TypeScript API for both iOS and Android with platform-specific native bridges.
  • No ATT Required — uses IDFV on iOS (exempt from App Tracking Transparency). No IDFA, no user prompts.
  • Debug Logging — enable with { debugLogging: true } in configure options to trace SDK behavior.
  • Zero Dependencies — no third-party runtime dependencies. Only peer dependencies on react and react-native.

Documentation

Guide Description
Integration Guide Step-by-step setup from zero to working deep links
API Reference Complete reference for all public types and methods
Deferred Deep Links How deferred deep linking works and how to use it
Attribution Install attribution tiers and confidence scores
Error Handling Every error case with recommended recovery actions
Troubleshooting Common issues and solutions
Firebase Migration Migrate from Firebase Dynamic Links to WarpLink
Architecture How the SDK bridges to native iOS and Android SDKs

Links

License

MIT License. See LICENSE for details.