helpshift-plugin-sdkx-react-native
v10.3.1
Published
A React Native plugin for Helpshift SDK X.
Downloads
239
Readme
helpshift-plugin-sdkx-react-native
Helpshift SDK X plugin for React Native.
Getting Started
Follow the Getting Started page of Helpshift Developer Guide for details like app ID, domain, etc.
Requirements
- Node v18 or above
- Android Development Setup
- iOS Development Setup
Helpshift APIs
Initialize
// Import helpshift API's from the 'helpshift-plugin-sdkx-react-native' plugin.
import {
install,
showConversation,
showFAQsWithConfig,
showFAQSectionWithConfig,
logout,
login
} from 'helpshift-plugin-sdkx-react-native';
Install
let installConfig = {
'enableLogging': true,
'manualLifecycleTracking': false,
'runtimeVersion': EXAMPLE_REACTNATIVE_VERSION // Developer need to pass react-native version.
}
let appId = Platform.select({
android: <Android_Platform_Id>,
ios: <iOS_Platform_Id>,
});
if (appId != null) {
install(appId, <domain>, installConfig);
} else {
//Display your error here.
}
- additionaly for iOS platform there is a requirement to link the native parts of the library:
$ npx pod-install
showConversation
const config = {<SDK_CONFIGRATION_OBJECT_MAP>};
showConversation(config);
Show FAQs
showFAQsWithConfig(<SDK_CONFIGRATION_OBJECT_MAP>);
Showing a Particular FAQ Section
showFAQSectionWithConfig(
<FAQ_SECTION_PUBLISH_ID>, <SDK_CONFIGRATION_OBJECT_MAP>
);
Showing a Particular FAQ
showSingleFaqWithConfig(
<FAQ_QUESTION_PUBLISH_ID>, <SDK_CONFIGRATION_OBJECT_MAP>
)
Where <SDK_CONFIGRATION_OBJECT_MAP> is config object. you can refer here For SDK Configrations.
setLanguage
setLanguage(<LANGUAGE_CODE>)
For <LANGUAGE_CODE> please refer this document here
SDK Configuration
For details on SDK Configuration, follow the SDK Configuration page on Helpshift Developer Guide.
enableLogging
let installConfig = {
'enableLogging': true,
}
install(<APP_ID>, <domain>, installConfig);
presentFullScreenOniPad
const config = {
presentFullScreenOniPad: false
};
showConversation(config);
Users
For details on user related APIs, follow Helpshift Developer Guide.
Login
let config = {
userName: "<USER_NAME>",
userEmail: "<USER_EMAIL>",
userId: "<USER_ID>",
userAuthToken: "<GENERATED_USER_AUTH_TOKEN>"
};
login(config, (isLoginSuccessful: boolean) => {
console.log("Is login successful " + isLoginSuccessful)
});
Logout
logout()
Notifications
You need to install your notification plugin to use notifications. Use the registerPushToken
and handlePush
APIs for this. Refer iOS and Android Helpshift Developer Guide for more details.
CIF Support
const cifs = { stock_level: { type: 'number', value: '1505' }, age: { type: 'number', value: '20' } };
const config = {
cifs: cifs,
};
showConversation(config);
Refer Helpshift Developer Guide CIF Support for more details.
Outbound Support
handleProactiveLink(<PROACTIVE_LINK> , <USER_LOCAL_CONFIG>);
Refer Helpshift Developer Guide For Outbound Support for more details.