0.0.2 • Published 6 months ago

rs-slim v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

rs-slim

A minimal rudderstack client.

Background

Designed to be a slim client for Rudderstack that implements that bare minimum, common use cases – identify, page, and track. rs-slim always uses Rudderstack's beacon API and stores data in localStorage. Useful for applications where bundle size is kept to a minimum and you don't need to full suite of features of the Rudderstack SDK.

Usage

init

Call init (preferably once) before attempting to send any events. Parameters are

  • dataPlaneUrl : found in Rudderstack under setup guide
  • writeKey: found in Rudderstack under setup guide
  • queueLength (optional): number of events stored in the queue before it's sent to the API
  • queueTimeoutInMS (optional): duration in milliseconds before queued events are sent to the API.

identify

Saves the provided user traits to localStorage and sends an identify event

page

Trigger a page event with a pageName parameter.

reset

Clear all saved user traits from localStorage

track

Trigger a track event with eventName and properties parameters.

  • eventName - event on the request
  • properties- the properties object on the request
0.0.2

6 months ago

0.0.1

7 months ago