npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ashishsoni1234/react-native-smartlink

v0.1.0

Published

React Native SDK for Deeplink deep linking and deferred attribution

Readme

react-native-smartlink

React Native / Expo SDK for SmartLink — deep links, deferred deep linking, and typed API helpers.

Requirements

  • React Native 0.73+ (or Expo SDK that ships a compatible RN)
  • react and react-native as peer dependencies
  • A running SmartLink backend API and redirect server (staging or self-hosted)

Install

npm install react-native-smartlink
# or
yarn add react-native-smartlink
# or
pnpm add react-native-smartlink

Peers (usually already present in an RN/Expo app):

npm install react react-native

Quick start

import { useEffect } from 'react';
import { createDeeplinkSDK } from 'react-native-smartlink';

const sdk = createDeeplinkSDK({
  apiKey: 'your-api-key',
  apiUrl: 'https://api-smartlink.example.com',
  redirectUrl: 'https://go-smartlink.example.com',
});

export function DeepLinkBootstrap() {
  useEffect(() => {
    const unsubscribe = sdk.onDeepLink((params) => {
      // Cold start + runtime links
      // params.shortCode, params.query, params.customParams, ...
      console.log('Deep link:', params);
    });

    return () => {
      unsubscribe();
      sdk.stop();
    };
  }, []);

  return null;
}

onDeepLink starts Linking listeners automatically. You can also call sdk.start() / sdk.stop() yourself.

Configuration

| Option | Required | Description | |--------|----------|-------------| | apiKey | Yes | API key sent as X-API-Key on deferred match | | apiUrl | No | Backend base URL (default http://localhost:5000) | | redirectUrl | No | Redirect / link domain base URL (default http://localhost:4000) |

Environment variables (recommended)

EXPO_PUBLIC_API_URL=https://api-smartlink.example.com
EXPO_PUBLIC_REDIRECT_URL=https://go-smartlink.example.com
EXPO_PUBLIC_APP_SCHEME=myscheme
const sdk = createDeeplinkSDK({
  apiKey: process.env.EXPO_PUBLIC_API_KEY ?? 'your-api-key',
  apiUrl: process.env.EXPO_PUBLIC_API_URL,
  redirectUrl: process.env.EXPO_PUBLIC_REDIRECT_URL,
});

Deep link listener

const unsubscribe = sdk.onDeepLink((params) => {
  // params.url
  // params.path
  // params.shortCode
  // params.query          // all query string key/values
  // params.customParams
  // params.deferred       // true when from deferred match
});

Uses React Native Linking:

  • Cold start: Linking.getInitialURL()
  • Runtime: Linking.addEventListener('url', ...)

Parse a URL manually

import { parseDeepLinkParams } from 'react-native-smartlink';

const params = parseDeepLinkParams('myscheme://product/123?campaign=spring');
// params.shortCode, params.query, ...

Also works with https Universal / App Links:

parseDeepLinkParams('https://go-smartlink.example.com/abc123?utm_source=email');

Deferred deep linking

After install (user opened a SmartLink before the app was installed):

const result = await sdk.getDeferredDeepLink();

if (result.matched && result.params) {
  // Navigate using result.params
}

// Full server payload:
result.raw; // DeferredMatchResponse

Calls POST {redirectUrl}/v1/deferred/match. If you omit a fingerprint, the server can derive one from IP + User-Agent.

Optional fingerprint:

await sdk.getDeferredDeepLink('optional-client-fingerprint');

Navigation helpers

Wire the SDK to React Navigation / Expo Router:

sdk.setNavigator((screen, params) => {
  // navigation.navigate(screen, params)
});

sdk.navigateToScreen('ProductDetail', { productId: '123' });

Custom events (in-memory queue)

sdk.trackEvent('purchase', { amount: 99.99 });
sdk.getQueuedEvents(); // until server ingestion is enabled

Typed API client

const client = sdk.getApiClient();

await client.getBackendHealth();
await client.getRedirectHealth();
await client.matchDeferred({ fingerprint: 'optional' });

Native setup (scheme + Universal / App Links)

The SDK listens to URLs the OS delivers. You still must register schemes / domains in the host app.

Custom URL scheme (Expo)

In app.json / app.config.ts:

{
  "expo": {
    "scheme": "myscheme"
  }
}

Test on iOS simulator:

xcrun simctl openurl booted "myscheme://abc123?campaign=spring"

iOS Universal Links

  1. In the SmartLink admin, set App Linking / Team ID for your org.
  2. Ensure the redirect host serves /.well-known/apple-app-site-association.
  3. Add associated domains in the app, e.g. applinks:go-smartlink.example.com.

Expo example:

ios: {
  associatedDomains: ['applinks:go-smartlink.example.com'],
}

Android App Links

  1. Set SHA-256 cert fingerprint in SmartLink app-linking settings.
  2. Ensure the redirect host serves /.well-known/assetlinks.json.
  3. Add intent filters for your link host in the Android config / AndroidManifest.

Staging example URLs

If you use the project staging hosts:

| Service | URL | |---------|-----| | Backend API | https://api-smartlink.24livehost.com | | Redirect / short links | https://go-smartlink.24livehost.com |

createDeeplinkSDK({
  apiKey: 'your-key',
  apiUrl: 'https://api-smartlink.24livehost.com',
  redirectUrl: 'https://go-smartlink.24livehost.com',
});

API surface

import {
  createDeeplinkSDK,
  DeeplinkSDK,
  DeeplinkApiClient,
  parseDeepLinkParams,
  deepLinkParamsFromDeferred,
  subscribeToDeepLinks,
} from 'react-native-smartlink';

import type {
  DeeplinkSDKConfig,
  DeepLinkParams,
  DeepLinkListener,
  DeferredDeepLinkResult,
  HealthResponse,
  DeferredMatchRequest,
  DeferredMatchResponse,
} from 'react-native-smartlink';

Troubleshooting

| Problem | What to check | |---------|----------------| | Listener never fires | Scheme / associated domains / intent filters; try simctl openurl / adb with the same scheme | | Deferred match always matched: false | Redirect server deployed; recent click recorded; same network/IP as click when fingerprint is server-derived | | Health check fails | apiUrl / redirectUrl reachable from the device/emulator (not localhost on a physical device) | | TypeScript can’t resolve package | Restart TS server; ensure node_modules/react-native-smartlink/dist exists after install |

License

MIT