Install
Qonversion SDK package is available on npm.Launching the SDK
First of all, you need to create the launching configuration. It can be made using theQonversionConfigBuilder class as follows.
Qonversion.initialize() before you call Qonversion.getSharedInstance() as it will throw an Error if no instance is configured.
Note that some configurations can be changed after the initialization, but we recommend setting everything necessary before it. Nonetheless, if you want to change, let’s say, the log tag of the configured instance, call the corresponding method on it.
Properties
User properties are attributes you can set on a user level. You can send user properties to third-party platforms and use them in Qonversion for customer segmentation and analytics. You can read more about user properties here. We defined some common case properties and provided API for adding them:UserPropertiesBuilder class, which provides a well-known builder pattern for combining properties. After you have set all the necessary properties, you can send them to Qonversion with a single call of the following method.
userProperties method, that returns an object, containing all the properties.
UserProperties class contains several utility fields and methods:
| Field | Description |
|---|---|
properties | List of all user properties |
definedProperties | Subset of all user properties, which were set using Qonversion-defined keys |
customProperties | Subset of all user properties, which were set using custom keys |
flatPropertiesMap | A flattened version of all user properties as a key-value map |
flatDefinedPropertiesMap | A flattened version of defined user properties as a key-value map |
flatCustomPropertiesMap | A flattened version of custom user properties as a key-value map |
| Method | Arguments | Description |
|---|---|---|
getProperty | key - string | Searches for a property with the given property key in all properties list |
getDefinedProperty | key - UserPropertyKey | Searches for a property with the given Qonversion-defined property key in the defined properties list. |
Purchases
For now, Qonversion Web SDK accepts only Stripe purchases. We are working on supporting more billing providers. To send the purchase to Qonversion after you receive a successful response from Stripe, call the following method and provide the received data.Entitlements
To let Qonversion handle user entitlements, you should configure them in the Qonversion dashboard first. After you have it done, Qonversion will grant entitlements to the current user each time you send us a successful purchase. Then you can get the current user entitlements as follows.Identity
User Identity allows cross-device & cross-platform user identification and access management. You can read more about it here. When a user logs into his account, callidentify().
logout()
identify() at work.
Stripe Integration User Properties