@duicorn/nativescript-posthog
v3.4.17
Published
Add a plugin description
Downloads
127
Maintainers
Readme
@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