Skip to content
Logo

SDK options

OptionTypeDefault
clientIdstringrequiredYour project's client ID
clientSecretstringServer only. Never ship it to browsers
apiUrlstringhttps://api.flarepanel.dev with op1.jsSet it to https://api.flarepanel.dev with the @openpanel/* packages, or to your own API when self-hosting
trackScreenViewsbooleanfalseA screen_view on load and on client-side route changes
trackOutgoingLinksbooleanfalseA link_out event for clicks to other sites
trackAttributesbooleanfalseEvents from data-track attributes
trackHashChangesbooleanfalseTreat #hash changes as route changes
filter(payload) => booleanReturn false to drop an event
disabledbooleanfalseQueue events until op.ready() is called, for example after cookie consent
debugbooleanfalseLog every call to the console

Methods

Method
track(name, properties?)Send an event
identify({ profileId, ...})Tie events to a user and update their profile
increment / decrement({ profileId, property, value? })Change a numeric profile property
revenue(amount, properties?)Send a revenue event
setGlobalProperties(properties)Add properties to every event
screenView(path?, properties?)Send a screen view manually
ready()Start sending queued events (with disabled: true)
clear()Forget the current profile and device