Skip to content

React Native SDK

Native module for deferred deep linking and programmatic link creation.

Version: 0.2.2 · npmjs.com/package/flinku-react-native

Installation

bash
npm install flinku-react-native

Setup

Configure once at app startup with your project baseUrl. Complete iOS Associated Domains and Android App Links as in the Quick Start .

Use your publishable key (flk_pk_) in apps. Never embed your secret key (flk_live_).

typescript
import { Flinku } from 'flinku-react-native';

const flinku = new Flinku({
  baseUrl: 'https://yourapp.flku.dev',
  userId: 'unique-device-id', // use react-native-device-info or your own
  apiKey: 'flk_pk_...', // optional — required for createLink / createLinkInstant
});

match()

typescript
const result = await flinku.match();
if (result && result.deepLink) {
  // Navigate using your router
}

Requires Allowed Domains configured in project settings.

typescript
const created = await flinku.createLink({
  title: 'Summer Campaign',
  deepLink: 'yourapp://promo',
  params: { ref: 'instagram' },
});
console.log(created.shortUrl);

Full TypeScript example

typescript
import React, { useEffect, useState } from 'react';
import { Flinku } from 'flinku-react-native';

export function FlinkuBootstrap() {
  const [pending, setPending] = useState(null);

  useEffect(() => {
    const flinku = new Flinku({
      baseUrl: 'https://yourapp.flku.dev',
      userId: 'unique-device-id',
      apiKey: 'flk_pk_...',
    });
    void (async () => {
      const m = await flinku.match();
      if (m) setPending(m);
    })();
  }, []);

  const shareCampaignLink = async () => {
    const flinku = new Flinku({
      baseUrl: 'https://yourapp.flku.dev',
      userId: 'unique-device-id',
      apiKey: 'flk_pk_...',
    });
    const link = await flinku.createLink({
      title: 'Partner promo',
      deepLink: 'yourapp://promo',
      params: { ref: 'instagram' },
    });
    console.log('Short URL:', link.shortUrl);
  };

  return (
    
      {pending?.deepLink ? (
        Deferred link: {pending.deepLink}
      ) : (
        No pending Flinku link
      )}
      
    
  );
}

The modern Firebase Dynamic Links replacement.