Migration
Beta to V1
We are happy to announce the release of `v1` of the Openpanel SDK. This release includes a lot of improvements and changes to the SDK. This guide will help you migrate from the `beta` version to the `v1` version.
General
The Openpanel class is now called OpenPanel!
Options
- Renamed:
apitoapiUrl - Added:
disabled - Added:
filter
Methods
- Renamed:
eventmethod is now calledtrack - Renamed:
setProfileandsetProfileIdis now calledidentify(and combined) - Changed:
increment('app_opened', 5)is nowincrement({ name: 'app_opened', value: 5, profileId: '123' }). So profile ID is now required. - Changed:
decrement('app_opened', 5)is nowdecrement({ name: 'app_opened', value: 5, profileId: '123' }). So profile ID is now required. - Improved:
screenViewmethod has 2 arguments now. This change is more aligned with@openpanel/react-native.
Script tag
- New:
https://openpanel.dev/op1.jsshould be used instead ofop.js(note the filename) - Renamed: Tracking with attributes have changed. Use
data-track="my_event"instead ofdata-event="my_event"
@openpanel/nextjs
- Renamed:
OpenpanelProvidertoOpenPanelComponent - Removed: All exported methods (trackEvent etc). Use the
useOpenPanelhook instead since these are client tracking only - Moved:
createNextRouteHandleris moved to@openpanel/nextjs/server