Togo
Togo
Apply for the betaSign in

Changelog@togohq/sdk-browser

@togohq/sdk-browser 2.1.0

@togohq/sdk-browser 2.1.0

  • Browser SDK

On this site since

Breaking

  • email and name are no longer keys of set or setOnce: pass them as the email and name parameters. A plain email or name key in set no longer type-checks, and the server drops one as person_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, so verify_tracking reports property_reserved or person_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, in production too. Pass it to your error tracker: onError: (e) => Sentry.captureMessage(e.message). Each error carries a code.
  • setPersonProperties({ email, name }) sets a person's email address and name through typed parameters. null removes one.

Fixed

  • A queue_full caused by one oversized event names that event, instead of reading as being offline.

Migration

Pass email and name as parameters of setPersonProperties(), not as keys of set.

Before
setPersonProperties({ set: { email: user.email, name: user.name } });
After
setPersonProperties({ email: user.email, name: user.name });

The old form stops working in 2.1.0.