Skip to main content
Back to plugins
@capgo/capacitor-appinsights
Tutorial
@capgo/capacitor-appinsights

AppInsights

Track app usage, performance metrics, and user behavior with Apptopia AppInsights

Guide

Tutorial on AppInsights

Using @capgo/capacitor-appinsights

A wrapper around the https://github.com/apptopia/appinsights SDK.

Install

bun add @capgo/capacitor-appinsights
bunx cap sync

What This Plugin Exposes

  • init - Initialize the AppInsights SDK.
  • setUserId - Set or update the user ID after initialization.
  • getState - Get the current state of the SDK.

Example Usage

init

Initialize the AppInsights SDK.

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

await CapacitorAppInsights.init({} as {
    partnerId: string; // Provided by our business unit
    partnerKey: string; // Provided by our business unit
  });

setUserId

Set or update the user ID after initialization.

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

await CapacitorAppInsights.setUserId({} as { userId: string });

getState

Get the current state of the SDK.

import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';

await CapacitorAppInsights.getState();

Full Reference

Keep going from Using @capgo/capacitor-appinsights

If you are using Using @capgo/capacitor-appinsights to plan native plugin work, connect it with @capgo/capacitor-appinsights for the implementation detail in @capgo/capacitor-appinsights, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.