flinku-react-native
v0.2.1
Published
React Native SDK for Flinku deep linking
Maintainers
Readme
flinku-react-native
React Native SDK for Flinku — deferred deep linking for React Native apps.
Installation
npm install flinku-react-native @react-native-async-storage/async-storageUsage
import { Flinku } from 'flinku-react-native';
const flinku = new Flinku({
userId: 'firebase-user-uid',
baseUrl: 'https://yourapp.flku.dev',
});
// On app launch — match deferred deep link
const link = await flinku.match();
if (link) {
console.log(link.deepLink); // 'yourapp://screen'
console.log(link.params); // { ref: 'instagram', promo: 'SAVE20' }
// Navigate to the right screen
}
// Create a link programmatically
const flinkuWithKey = new Flinku({
userId: 'firebase-user-uid',
baseUrl: 'https://yourapp.flku.dev',
apiKey: 'flk_live_your_api_key',
});
const created = await flinkuWithKey.createLink({
title: 'Summer Campaign',
deepLink: 'yourapp://promo',
params: { ref: 'instagram', promo: 'SAVE20' },
});
console.log(created.shortUrl); // 'https://yourapp.flku.dev/summer-campaign'License
MIT
