@devlowkey/chat-sdk-react-native
v0.0.30
Published
Lowkey Chat SDK for React Native
Downloads
2,015
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-core
2. Install peer dependencies:
@react-native-clipboard/clipboard
expo-image
react-native-keyboard-controller
react-native-mmkv
react-native-quick-crypto
react-native-unistyles
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-svg
andreact-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!