@duicorn/nativescript-posthog
by duicorn | v0.2.2
NativeScript plugin for the open source product analytics software Posthog
npm i --save @duicorn/nativescript-posthog

@duicorn/nativescript-posthog

NativeScript plugin for PostHog product analytics. Not all configuration options are implemented yet, but basic event capturing and feature flags are supported.

ns plugin add @duicorn/nativescript-posthog

Usage

import Posthog from '@duicorn/nativescript-posthog';

// initialize with you posthog key
Posthog.setup('<api_key>', {
host: 'https://app.posthog.com',
recordScreenViews: true,
captureApplicationLifecycleEvents: true,
});

// capture an event
Posthog.capture('app event');

// identify the user
Posthog.identify('uniqueID', {email: ''});

License

Apache License Version 2.0