@togohq/sdk-node 2.1.0
@togohq/sdk-node 2.1.0
- Node.js SDK
Breaking
emailandnameare no longer keys ofsetorsetOnce: pass them as theemailandnameparameters. A plainemailornamekey insetno longer type-checks, and the server drops one asperson_property_reserved.- A property key starting with
$is reserved for Togo. Under a live key the SDK drops it, logs it once and still sends the event; under a test key it is sent, soverify_trackingreportsproperty_reservedorperson_property_reserved.
New
init({ onError })is called once for every event, or part of one, that will not be recorded, and once when the client stops sending.flush()waits for it. Pass it to your error tracker. Each error carries acode.setPersonProperties({ email, name }, person)sets a person's email address and name through typed parameters.nullremoves one.
Fixed
- An empty or over-long event name is dropped on its own, instead of with the whole batch it was in.
Migration
Pass email and name as parameters of setPersonProperties(), not as keys of set.
setPersonProperties({ set: { email: user.email, name: user.name } }, { userId });setPersonProperties({ email: user.email, name: user.name }, { userId });