Skip to main content

Quickstart

Before Getting Started

Before you start integrating Dyte into your application, make sure you've read the Getting Started with Dyte topic and completed the steps in the Integrate Dyte section.

The DyteClient is the root class of the SDK. It is the main entry point of the SDK. It is the only class that you need to instantiate in order to use the SDK.

To instantiate DyteClient, you can run the following command:

import { useDyteClient } from '@dytesdk/react-native-core';

const [client, initClient] = useDyteClient();

const meeting = await initClient({
authToken: 'YourAuthToken',
});
await meeting.joinRoom();

You can get the authToken using our backend APIs and then pass it to the init method of DyteClient.

info

Once join room process completes roomJoined event is emitted on meeting.self namespace. If you want to take any actions like enabling audio, video or start and stop recording etc. it should be done after the roomJoined event is fired.

For example:

meeting.self.on('roomJoined', () => {
console.log('User has joined the room', meeting.self.roomJoined);
// run my actions.
});

await meeting.joinRoom();

Leave room

Leave the meeting room.

await meeting.leaveRoom();