@gradeup/tap-web-sdk
v0.0.15
Published
Push structured events from web to any server
Downloads
21
Readme
Tap Web SDK
Send structured events from web to any server 🚀
Requirements
Needs Fetch API for this to work. Use unfetch if you want to support older browser
Install
npm i @gradeup/tap
Usage
import tap from "@gradeup/tap";
// Must initialise sdk after user has logged in
tap.init("https://example.com/analytics", { userId: 2, name: "Example User" });
// Push event whenever you want
const event = {
event: "UpVote"
itemId: 1,
};
tap.event.push(event);