@duicorn/nativescript-posthog
作者:duicorn | v3.4.17
添加插件描述
npm i --save @duicorn/nativescript-posthog

@duicorn/nativescript-posthog

npm install @duicorn/nativescript-posthog

使用情况

// 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');

自动捕获

此插件实现了 NativeScript 应用程序的简单自动捕获功能。要启用它,请使用 autocapture: true 设置 PostHog 对象。要排除 tap 元素,可以添加 posthogAutoCapture="false" 属性到该元素