Follow

Add User Credentials

Add User Credentials

User credentials help you customize campaigns to your users. After you determine what type of user credentials your app uses, follow the steps below. Check Before You Begin for information about user credentials.

To add user credentials

  1. In your JavaScript, add the following lines of code.

    If you use only username and email credentials for your users, add only username and email. If you have additional user credentials you want to add for your users, such as Facebook ID or Twitter ID, add these credentials also. Credentials must be unique across all your users.

    var kahunaUserCredentials = Kahuna.createUserCredentials();
    kahunaUserCredentials.add(kahunaUserCredentials.USERNAME_KEY, 'USERNAME_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.EMAIL_KEY, 'USER_EMAIL_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.FACEBOOK_KEY, 'FACEBOOK_ID_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.TWITTER_KEY, 'TWITTER_ID_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.LINKEDIN_KEY, 'LINKEDIN_ID_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.USER_ID_KEY, 'USER_ID_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.INSTALL_TOKEN_KEY, 'INSTALL_TOKEN_HERE');
    kahunaUserCredentials.add(kahunaUserCredentials.GOOGLE_PLUS_ID, 'GOOGLE_PLUS_ID_HERE');
    Kahuna.login(kahunaUserCredentials);
  2. In your JavaScript, add the following code to send Kahuna the credentials of users who log into your application or register for the first time.

    var credentials = KahunaUserCredentials();
    Kahuna.login(credentials);
  1. In your JavaScript, add the following code so that Kahuna knows when a user logs out of your application.

    Kahuna.logout();

You have successfully added user credentials. Now, follow the steps in Set Up In-App Messaging.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments