0.0.3 • Published 1 year ago
rs-slim v0.0.3
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 guidewriteKey: found in Rudderstack under setup guidequeueLength(optional): number of events stored in the queue before it's sent to the APIqueueTimeoutInMS(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-eventon the requestproperties- thepropertiesobject on the request