Skip to main content

Migrating to v2 from v1

The only change v2 introduces is tenant scoping across the sdk.

Tenant scoping

Skip this guide if you don’t use multi-tenant architecture, i.e. if you don’t pass tenant id in userToken jwt payload and don’t use tenant id fields for preferences and inbox. Pass tenantId in identify and the rest of the SDK, including preferences and inbox, uses it. The per-call tenantId params in v1 still work and override the global one, so you can migrate gradually or leave your v1 code as is.
v2
v1
IMPORTANT: Whichever tenant you pass in sdk, it must be included in scope.tenant_id of the userToken, else the server throws scoping error. If you face any issue in migration process please reach out to us on our slack community or drop an email to us on support@suprsend.com