Install with npm:
npm install @putdotio/pas-jsimport 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,
});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();| Method Name | Parameters |
|---|---|
| alias | ({ id: string/number, hash: string }) |
| identify | ({ id: string/number, hash: string, properties?: object }) |
| track | (name: string, properties?: object) |
| pageView | - |
See CONTRIBUTING.md
