Capacitor SDK
Same surface area as the React Native SDK for Capacitor hybrid apps.
Version: 0.2.2 · npmjs.com/package/flinku-capacitor
Installation
bash
npm install flinku-capacitorAPI
Use configure, match(), and createLink() the same way as in the React Native SDK documentation.
Use your publishable key (flk_pk_) in apps. Never embed your secret key (flk_live_).
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_pk_...', // optional — required for createLink / createLinkInstant
});
const match = await flinku.match();
if (match?.deepLink) {
return match.deepLink;
}
return null;
}
export async function makeShareLink() {
const flinku = new Flinku({
baseUrl: 'https://yourapp.flku.dev',
userId: 'unique-device-id',
apiKey: 'flk_pk_...',
});
return flinku.createLink({
title: 'Capacitor promo',
deepLink: 'myapp://promo',
params: { ref: 'web' },
});
}