@capgo/capacitor-appinsights
v8.0.57
Published
A wrapper around the https://github.com/apptopia/appinsights SDK
Readme
@capgo/capacitor-appinsights
Integrate the Apptopia AppInsights SDK in your Capacitor app with a small TypeScript API. Initialize the panel SDK, set a user ID and read its state.
🤖 Building with an AI coding agent? Install Capgo skills so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use
@capgo/capacitor-appinsightsin your Capacitor app:npx skills add Cap-go/capgo-skills. Then ask your agent: "Add @capgo/capacitor-appinsights to my Capacitor app and wire it up." Agent setup guides · Hosted MCP
Key features
- Initialize:
init()starts the AppInsights SDK with your partner ID. - User ID:
setUserId()sets or updates the user ID after initialization. - State:
getState()returns the current SDK state. - Official SDK: wraps the
com.appinsights:appinsightsAndroid library.getPluginVersion()also works on iOS, and on web it returnswebinstead of a version number. - Platforms: Android. The AppInsights SDK methods (
init(),setUserId()andgetState()) are Android only and reject on iOS and web.
Why Capacitor AppInsights?
The only Capacitor plugin for integrating the AppInsights SDK:
- Market intelligence - Access app store analytics and competitive data
- User insights - Track and analyze user behavior across platforms
- SDK wrapper - Clean JavaScript API for the native AppInsights SDKs
- Cross-platform - Works on iOS and Android
Essential for apps needing market intelligence, competitive analysis, and advanced analytics beyond standard tools.
Documentation
The most complete doc is available here: https://capgo.app/docs/plugins/appinsights/
Compatibility
| Plugin version | Capacitor compatibility | Maintained | | -------------- | ----------------------- | ---------- | | v8.*.* | v8.*.* | ✅ | | v7.*.* | v7.*.* | On demand | | v6.*.* | v6.*.* | ❌ | | v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
Install
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-appinsights` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-appinsights
npx cap syncAPI
init(...)
init(options: { partnerId: string; partnerKey: string; }) => Promise<void>Initialize the AppInsights SDK
| Param | Type | Description |
| ------------- | ------------------------------------------------------- | -------------------------------------------- |
| options | { partnerId: string; partnerKey: string; } | Configuration options for SDK initialization |
setUserId(...)
setUserId(options: { userId: string; }) => Promise<void>Set or update the user ID after initialization
| Param | Type | Description |
| ------------- | -------------------------------- | -------------- |
| options | { userId: string; } | User ID to set |
getState()
getState() => Promise<PanelSDKState>Get the current state of the SDK
Returns: Promise<PanelSDKState>
getPluginVersion()
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version
Returns: Promise<{ version: string; }>
Interfaces
PanelSDKState
| Prop | Type |
| ------------------------ | -------------------- |
| initCompleted | boolean |
| jobScheduled | boolean |
| permissionAcquired | boolean |
