@putdotio/pas-js
v3.0.0
Published
Browser analytics client for the put.io Analytics System.
Readme
Installation
Install with npm:
npm install @putdotio/pas-jsQuick Start
import createPasClient from "@putdotio/pas-js";
const pas = createPasClient();
pas.identify({
id: "42",
hash: "signed-user-hash",
properties: {
plan: "pro",
},
});
pas.track("transfer_completed", {
transfer_id: 123,
});Browser Tracking
The default client keeps an anonymous identifier in browser cookies and can send identity, event, and page-view payloads to PAS:
import createPasClient from "@putdotio/pas-js";
const pas = createPasClient();
pas.alias({ id: "42", hash: "signed-user-hash" });
pas.pageView();API
| Method Name | Parameters |
| :----------- | :----------------------------------------------------------- |
| alias | ({ id: string/number, hash: string }) |
| identify | ({ id: string/number, hash: string, properties?: object }) |
| track | (name: string, properties?: object) |
| pageView | - |
Docs
Contributing
See CONTRIBUTING.md
