npm i --save @duicorn/nativescript-posthog
- 版本:3.4.17
- GitHub: https://github.com/NativeScript/plugins
- NPM: https://npmjs.net.cn/package/%40duicorn%2Fnativescript-posthog
- 下载量
- 前一天:0
- 上周:36
- 上个月:586
@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"
属性到该元素