Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Initialization

Place this script on all public pages of the site inside the <head> element.

WarningDon't forget to replace the %YOUR_STORE_KEY% text with the current store key from your PersonaClick account

Initialization

Initialize the SDK object and use it anywhere in your application.

Warning

Remember to initialize the SDK only once on application launch.


Code Block
languagejs
themeFadeToGrey
import PersonaClick from '@personaclick/rn-sdk';
...
const pcsdk = new PersonaClick("YOUR_SHOP_ID", "Stream")

Additional Features

The initialization method has additional features - callback functions for success and error states.

Code Block
languagejs
themeFadeToGrey
personaclick("init", store_key, success, errorstream);

Initialization parameters

Name

Type

Requirement

Description

store_keystringrequiredThe current store key from the PersonaClick account.
success
stream
function
string
optionallyThe function will be executed after successful initialization.errorfunctionoptionallyThe function will be executed after unsuccessful initialization (any Personaclick API response other than 200)
requiredData stream code. Alphanumeric string (letters, numbers only). Max length: 16. It can be "ios", "android", or any other string value. It's used to distinguish between mobile apps, websites, and other events sources.

Example of use

Code Block
languagejs
themeFadeToGrey
personaclick("init", "c6d2fe5fdca0c8e51d10b07523bc07", function() {
    // Do something in case of successful initialization
    console.log("The PersonaClick initialization was successful");
}, function() {
    // Do something in case of unsuccessful initialization
    console.log("The PersonaClick initialization was unsuccessful");
}import PersonaClick from '@personaclick/rn-sdk';
...
const pcsdk = new PersonaClick("c6d2fe5fdca0c8e51d10b07523bc07", "android");


Table of Contents
maxLevel2
classpersonaclick-fixed-position