@duicorn/nativescript-posthog
by duicorn | v3.4.3
Add a plugin description
npm i --save @duicorn/nativescript-posthog

@duicorn/nativescript-posthog

npm install @duicorn/nativescript-posthog

Usage

// posthog.ts
import { PostHog } from "@duicorn/nativescript-posthog"

export const posthog = new PostHog('<ph_project_api_key>', {
// usually 'https://app.posthog.com' or 'https://eu.posthog.com'
host: '<ph_instance_address>',
autocapture: false
})
import { posthog } from 'posthog.ts';

posthog.capture('something clicked');
posthog.identify({
userProperties: { email: "[email protected]" }
});
posthog.isFeatureEnabled('myfeature');

Autocapture

This plugin implements a simple auto-capture feature for NativeScript apps. To enable it set up the PostHog object with autocapture: true. To opt out tap-elements you can add the attribute posthogAutoCapture="false" to that element