Using the Resonance SDK

The Resonance SDKs (Node.js, Ruby, Java, and more to come) are the way you can get personalized experiences from Resonance into your application. Check out the docs page for each SDK for specific instructions to view the available methods as well as installation procedures. This guide will explain at a high level how the SDKs are to be used.

If your language doesn’t have a Resonance SDK yet, send us a message so we can start building one for you!

API Key and Client ID

Your first step will be storing your API Key and Client ID as environment variables. These can be found (and the API Key can be created) on your Developer Settings page. Your API Key and Client ID are secrets and should never be used directly in your code; they should always be stored as environment variables. Each of these values will be used to instantiate the Resonance SDK.

Amplifier Store URL

The SDK communicates with the Amplifier Store to get the correct experience data for each user. You will establish the connection between the SDK in your app and the Amplifier Store using the connection URL found in your Developer Settings. This value is also best stored as an environment variable.

Instantiation

We recommend that you create a single instance of the Resonance SDK class, and use that instance wherever you need to fetch experience data from Resonance. When instantiating, you will pass in the Amplifier Store connection URL, along with your Client ID and API Key. You can also connect Resonance to your analytics provider at this time. The supported analytics providers can be found on the SDK API pages.

Get personalization data

You can use your instance of the Resonance SDK class to get personalization data. You will pass in some user data, including a user ID, and Resonance will return the correct experience for that user. YOu can also pass in default data to this method, which will be returned if there are personalized experiences for a particular user. Repeat this process in each location that you want to create personalized experiences.