npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-kustomer-sdk

v2.1.1

Published

Kustomer SDK for React Native

Downloads

17

Readme

Kustomer SDK for React Native

Getting started

$ npm install react-native-kustomer-sdk --save

Using React Native >= 0.60

Linking the package manually is not required anymore with Autolinking.

Using React Native < 0.60

$ react-native link react-native-kustomer-sdk

Install native Kustomer libraries

Android

Gradle

Include the library in your android/app/build.gradle:

implementation 'com.kustomer.chat:ui:2.9.9'

iOS

CocoaPods

The preferred installation method is with CocoaPods. Add the following to your Podfile:

pod 'KustomerChat'

Configure

Android

Initialize Kustomer in your MainApplication onCreate function:

import com.kustomer.core.models.KusResult;
import com.kustomer.ui.Kustomer;
import android.util.Log;

public class MainApplication extends Application implements ReactApplication {
  @Override
  public void onCreate() {
    Kustomer.Companion.init(this, API_KEY, null, booleanKusResult -> {
      Log.i("Kustomer", "Init result: " + booleanKusResult);
      return null;
    });
  }
}

To customize Kustomer's theme, add a new style in colors.xml overwriting the values you want to replace, for example:

<style name="KusAppTheme.Overlay" parent="KusAppTheme">
    <item name="kusColorHeader">#FFFFFF</item>
    <item name="kusColorOnHeader">#FFFFFF</item>
    <item name="kusColorOnHeaderVariant">#FFFFFF</item>

    <item name="kusColorAgentBubble">#FFFFFF</item>
    <item name="kusColorOnAgentBubble">#FFFFFF</item>
    <item name="kusColorUrlLinkOnAgentBubble">#FFFFFF</item>
    ...
</>

There are more possible items. For more information about Android customization: https://developer.kustomer.com/chat-sdk/v2-Android/docs/customize-colors-updated

iOS

Create a file named KustomerHelper.swift with this content:

import Foundation
import KustomerChat
import UIKit

@objc
class KustomerHelper: NSObject {
    @objc
    func initKustomer(_ launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
        Kustomer.configure(apiKey: API_KEY, options: nil, launchOptions: launchOptions)
    }
}

Add to you AppDelegate.m file this import:

#import "your_project_name-Swift.h"

Initialize Kustomer in your AppDelegate.m didFinishLaunchingWithOptions function:

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  KustomerHelper *obj = [[KustomerHelper alloc] init];
  [obj initKustomer:launchOptions];
  return YES;
}

To customize Kustomer's theme follow the steps here: https://developer.kustomer.com/chat-sdk/v2-iOS/docs/customize-colors

Usage

Import the library to use its methods:

import KustomerSDK from "react-native-kustomer-sdk";

Methods

identify(token: String): Promise

Identify current user with a token, in order to recover its previous data, such as conversations and profile. This method is a promise so it will need some handling.

KustomerSDK.identify(token).then(...);

describeCustomer(customerData: customerData): void

Add data to the customer profile. You can use some pre-defined fields, or create custom ones from the dashboard.

KustomerSDK.describeCustomer(data);

resetTracking: void

Unlink the current identified user

KustomerSDK.resetTracking();

presentSupport: void

Show Kustomer's chat support UI

KustomerSDK.presentSupport();

Types

customerData

The fields email and phone are mandatory. custom can contain any number of custom fields, which can be created from the Kustomer dashboard.

type customerData {
  email: String,
  phone: String,
  custom: {String}
}