Quickstart
Installing the packages:
To get started with the Huddle01 React Native SDK, you can install the package using npm, yarn or pnpm:
pnpm add @huddle01/react-native
You also need to install a few additional packages for the SDK to function properly:
pnpm add react-native-get-random-values react-native-webrtc
Initializing the SDK:
After installing the package, inside your top-level index.js
file, make sure to import the additionally installed packages and call the registerGlobals()
method imported from react-native-webrtc
:
/**
* @format
*/
import { AppRegistry } from 'react-native';
import 'react-native-get-random-values';
import { registerGlobals } from 'react-native-webrtc';
import App from './App';
import { name as appName } from './app.json';
registerGlobals();
AppRegistry.registerComponent(appName, () => App);
Now you can initialize the SDK by using the useHuddle01
hook:
import { useHuddle01 } from '@huddle01/react';
function App() {
const { initialize } = useHuddle01();
initialize("YOUR_PROJECT_ID")
}