Web SDK upgrade guide
This guide provides information about how you can upgrade to the latest Swrve Web SDK. For information about the changes that have been made in each Web SDK release, see the Web SDK release notes.
Upgrading via NPMβ
If youβre upgrading via NPM, update your package .json dependency @swrve/web-sdk to the latest version of npm iΒ @swrve/web-sdk.
Version 3.0.0β
Swrve Web SDK v3.0.0 adds in-app message support to the Web SDK. No code changes are required to render in-app messages, but note the following:
- Several new APIs are available in this release, including Push Inbox, in-app message Message Center retrieval, manual content refresh, and embedded control campaigns. These are additive and optional. For more information, see the Integration guide.
Version 2.6.0β
There are no code changes required to upgrade to Swrve Web SDK v2.6.0.
Version 2.5.1β
There are no code changes required to upgrade to Swrve Web SDK v2.5.1.
Version 2.5.0β
There are no code changes required to upgrade to Swrve Web SDK v2.5.0.
Version 2.4.0β
There are no code changes required to upgrade to Swrve Web SDK v2.4.0.
Version 2.3.0β
There are no code changes required to upgrade to Swrve Web SDK v2.3.0.
Version 2.2.1β
There are no code changes required to upgrade to Swrve Web SDK v2.2.1.
Version 2.2.0β
There are no code changes required to upgrade to Swrve Web SDK v2.2.0.
Version 2.1.0β
There are no code changes required to upgrade to Swrve Web SDK v2.1.0.
Version 2.0.2β
There are no code changes required to upgrade to Swrve Web SDK v2.0.2.
Version 2.0.1β
There are no code changes required to upgrade to Swrve Web SDK v2.0.1.
Version 2.0.0β
There are several code changes and improvements added to Swrve Web SDK v2.0.0.
The following table lists the methods and fields that have changed or been moved.
| Removed | Summary |
|---|---|
getQueuedEvents | Removed to align with other Swrve SDKs. |
| Moved or changed | Summary |
|---|---|
createInstance | This was formerly the way to start up the SDK but it now only creates an instance. It also no longer initializes the SDK. Use initWithConfig instead. |
OnSwrveLoadedCallback | This callback was added to initWithConfig as an optional argument. It also no longer has an error message in its response. If something goes through, an exception is now thrown, which can be caught.It goes in after config. For example: initWithConfig({appId: <app_id>, apiKey: , externalUserId: }, ()=>{ console.log("optional callback")}); |
namedEvent | Renamed to event |
purchaseEvent | Renamed to purchase |
iapEvent | Renamed to iap |
Changes to initializationβ
The public methodΒ createInstance is still available for use but does not initialize the SDK. This means the SDK no longer starts from createInstance. If you want to have the same functionality as createInstance, please use initWithConfig.
Previous versionsβ
If you are upgrading from a version older than 2.0.0, please refer to the Web SDK integration guide.