UNPKG

react-native-crisp-chat-sdk

Version:
63 lines 2.39 kB
import * as React from 'react'; import { NativeModules, View } from 'react-native'; export let CrispSessionEventColors = /*#__PURE__*/function (CrispSessionEventColors) { CrispSessionEventColors[CrispSessionEventColors["RED"] = 0] = "RED"; CrispSessionEventColors[CrispSessionEventColors["ORANGE"] = 1] = "ORANGE"; CrispSessionEventColors[CrispSessionEventColors["YELLOW"] = 2] = "YELLOW"; CrispSessionEventColors[CrispSessionEventColors["GREEN"] = 3] = "GREEN"; CrispSessionEventColors[CrispSessionEventColors["BLUE"] = 4] = "BLUE"; CrispSessionEventColors[CrispSessionEventColors["PURPLE"] = 5] = "PURPLE"; CrispSessionEventColors[CrispSessionEventColors["PINK"] = 6] = "PINK"; CrispSessionEventColors[CrispSessionEventColors["BROWN"] = 7] = "BROWN"; CrispSessionEventColors[CrispSessionEventColors["GREY"] = 8] = "GREY"; CrispSessionEventColors[CrispSessionEventColors["BLACK"] = 9] = "BLACK"; return CrispSessionEventColors; }({}); const CrispChatSdk = NativeModules.CrispChatSdk; const CrispChat = () => { React.useEffect(() => { CrispChatSdk.show(); }, []); return /*#__PURE__*/React.createElement(View, null); }; export default CrispChat; export const configure = websiteId => { CrispChatSdk.configure(String(websiteId)); }; export const setTokenId = id => { CrispChatSdk.setTokenId(String(id)); }; export const setUserEmail = email => { CrispChatSdk.setUserEmail(String(email)); }; export const setUserNickname = name => { CrispChatSdk.setUserNickname(String(name)); }; export const setUserPhone = phone => { CrispChatSdk.setUserPhone(String(phone)); }; export const setUserAvatar = url => { CrispChatSdk.setUserAvatar(String(url)); }; export const setSessionSegment = segment => { CrispChatSdk.setSessionSegment(String(segment)); }; export const setSessionString = (key, value) => { CrispChatSdk.setSessionString(String(key), String(value)); }; export const setSessionBool = (key, value) => { CrispChatSdk.setSessionBool(String(key), Boolean(value)); }; export const setSessionInt = (key, value) => { CrispChatSdk.setSessionInt(String(key), Number(value)); }; export const pushSessionEvent = (name, color) => { CrispChatSdk.pushSessionEvent(String(name), color); }; export const resetSession = () => { CrispChatSdk.resetSession(); }; export const show = () => { CrispChatSdk.show(); }; //# sourceMappingURL=index.js.map