@penguin-wolf/braze-integration
v2.0.3
Published
1. install using `npm i @penguinwolf/braze-integration` 2. import into your project and construct the integration ```js import BrazeIntegration from "@penguin-wolf/braze-integration";
Readme
Basic Usage
- install using
npm i @penguinwolf/braze-integration - import into your project and construct the integration
import BrazeIntegration from "@penguin-wolf/braze-integration";
const sdkKey = '...';
const sdkUrl = '...';
const enableLogging = scriptData.WP_ENV === 'development'; // note: only enable logging on development environments
const brazeIntegration = new BrazeIntegration(sdkKey, sdkUrl, enableLogging);- You can access the Braze SDK instance directly from the brazeIntegration object
const braze = brazeIntegration.braze;
braze.logCustomEvent('set_location', {
location: 'QLD',
});Updating the Braze SDK
- Clone this repo
- Run
npm i @braze/web-sdk@latestto update the Braze SDK to the latest - Increment the package version in
package.json, runnpm ito updatepackage-lock.json - Commit and then tag with the new version like so
git tag -a v2.0.1, changing the version to matchpackage.json - Push changes and tags:
git push && git push --tags - Publish to npm with
npm publish(note: you will need to be authenticated with the @penguin-wolf npm account) - In a project that uses this module use
npm outdatedto check for updates and@penguin-wolf/braze-integrationto install the latest version of this module. Rebuild and deploy as normal
TODO
- [ ] Make warning for "multiple braze versions loaded" explicitly say which version is already loaded and which version we are trying to load now
