rs-slim
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i rs-slim

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

8.98 kB

Total Files

7

Last publish

Collaborators

  • rlittle