Guida
Tutorial su AppInsights
Utilizzo di @capgo/capacitor-appinsights
Un wrapper intorno a https://github.com/apptopia/appinsights SDK.
Installa
bun add @capgo/capacitor-appinsights
bunx cap sync
Cosa questo plugin espone
init- Inizializza l'istanza di AppInsights SDK.setUserId- Imposta o aggiorna l'ID dell'utente dopo l'inizializzazione.getState- Ottieni lo stato corrente del SDK.
Esempio di utilizzo
init
Inizializza l'applicazione 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
Imposta o aggiorna l'ID dell'utente dopo l'inizializzazione.
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.setUserId({} as { userId: string });
getState
Ottieni lo stato corrente del SDK.
import { CapacitorAppInsights } from '@capgo/capacitor-appinsights';
await CapacitorAppInsights.getState();
Riferimento completo
- GitHub: https://github.com/Cap-go/capacitor-appinsights/
- Documentazione: /docs/plugins/appinsights/