Capacitor SDK
Same surface area as the React Native SDK for Capacitor hybrid apps.
Installation
bash
npm install flinku-capacitorAPI
Use configure, match(), and createLink() the same way as in the React Native SDK documentation.
TypeScript example
typescript
import { Flinku } from 'flinku-capacitor';
export async function initFlinku() {
const flinku = new Flinku({
baseUrl: 'https://yourapp.flku.dev',
userId: 'unique-device-id', // use @capacitor/device
// apiKey: 'flk_live_xxx', // required for createLink
});
const match = await flinku.match();
if (match?.deepLink) {
return match.deepLink;
}
return null;
}
export async function makeShareLink() {
return Flinku.createLink({
apiKey: 'flk_live_your_api_key',
title: 'Capacitor promo',
deepLink: 'myapp://promo',
params: { ref: 'web' },
});
}