@devlowkey/chat-sdk-react-native
v0.3.4
Published
Lowkey Chat SDK for React Native
Downloads
96
Readme
Lowkey Chat SDK React Native
Lowkey Chat SDK modules for React Native.
Installation
1. Install Lowkey packages:
npm i @devlowkey/chat-sdk-react-native @devlowkey/chat-sdk-core2. Install peer dependencies:
@react-native-clipboard/clipboardexpo-imagereact-native-reanimatedreact-native-keyboard-controllerreact-native-mmkvreact-native-quick-cryptoreact-native-unistylesreact-native-gesture-handlerreact-native-pager-viewandreact-native-tab-view
Note: If your app does not support New Architecture use lower versions of following packages:
"react-native-mmkv": "~2.12.2",3. Configure SVG icons support:
- install
react-native-svgandreact-native-svg-transformer - configure Metro as per instruction
Usage
1. Create Lowkey Chat client instance:
import { LowkeyChatClient } from '@devlowkey/chat-sdk-core';
export const lowkeyClient = LowkeyChatClient.getInstance({
appId: 'YOUR LOWKEY APP ID',
appKey: 'YOUR LOWKEY APP KEY',
});2. Wrap your app with providers:
import { LowkeyChatProvider, LowkeyUiProvider } from '@devlowkey/chat-sdk-react-native';
...
return (
<LowkeyChatProvider lowkeyClient={lowkeyClient}>
<LowkeyUiProvider
// Example of UI themes customization
themes={{
light: {
colors: {
primary: 'green',
},
fonts: {
regular: 'Arial',
medium: 'Arial',
semiBold: 'Arial',
bold: 'Arial',
}
},
}}>
<YourApp />
</LowkeyUiProvider>
</LowkeyChatProvider>
);Now you can use the Lowkey SDK UI and features!
For more detailed examples please check our demo app on GitHub!
