Skip to main content
Back to plugins
@capgo/capacitor-appsflyer
Tutorial
by github.com/Cap-go

AppsFlyer

Add AppsFlyer attribution, analytics, deferred deep links, and OneLink support to your Capacitor app

Guide

Tutorial on AppsFlyer

Using @capgo/capacitor-appsflyer

Capacitor plugin for AppsFlyer attribution, analytics, and deep links.

Install

bun add @capgo/capacitor-appsflyer
bunx cap sync

What This Plugin Exposes

  • initSDK - Use this method to initialize and start AppsFlyer SDK. This API should be called as soon as the app launched.
  • startSDK - Use this method to start AppsFlyer SDK, only on manual start mode.
  • logEvent - Log an in-app event.
  • setCustomerUserId - Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer's unique ID and other devices' IDs. This ID is available in raw-data reports and in the Postback APIs for cross-referencing with your internal IDs.

Example Usage

initSDK

Use this method to initialize and start AppsFlyer SDK. This API should be called as soon as the app launched.

import { AppsFlyer } from '@capgo/capacitor-appsflyer';

await AppsFlyer.initSDK({} as AFInit);

startSDK

Use this method to start AppsFlyer SDK, only on manual start mode.

import { AppsFlyer } from '@capgo/capacitor-appsflyer';

await AppsFlyer.startSDK();

logEvent

Log an in-app event.

import { AppsFlyer } from '@capgo/capacitor-appsflyer';

await AppsFlyer.logEvent({} as AFEvent);

setCustomerUserId

Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer's unique ID and other devices' IDs. This ID is available in raw-data reports and in the Postback APIs for cross-referencing with your internal IDs.

import { AppsFlyer } from '@capgo/capacitor-appsflyer';

await AppsFlyer.setCustomerUserId({} as AFCuid);

Full Reference