1.2.2 • Published 7 months ago
react-native-brandmessenger-sdk v1.2.2
react-native-brandmessenger-sdk
Official Khoros Brand Messenger React Native SDK.
Installation
npm install react-native-brandmessenger-sdk
Usage
Please refer to https://developer.khoros.com/khorosbrandmessengerdocs/docs/install-brand-messenger-react-native-sdk for more details.
import BrandmessengerSdk from 'react-native-brandmessenger-sdk';
// ...
const initCompanyInfo = {
companyKey: '<COMPANY-KEY>',
applicationKey: '<APPLICATION-KEY>',
widgetId: '<WIDGET-ID>',
baseUrl: '<BASE-URL>',
authHandlerUrl: '<AUTH-HANDLER-URL>'};
BrandmessengerSdk.initWithCompanyKeyApplicationKeyWidgetId(initCompanyInfo, (error: null | string, response: null | string) => {
if (error !== null) {
// Cannot initialize SDK
} else {
// Initialization success
}
});
// ...
BrandmessengerSdk.loginAnonymousUser((error: null | string, response: null | string) => {
if (error !== null) {
// Login error
} else {
// Login success
}
});
// ...
BrandmessengerSdk.show((error: null | string, success: null | string) => {
if (error !== null) {
// Show chat screen error
} else {
// Show chat screen success
}
});
License
Apache 2.0