0.0.10 • Published 1 year ago

@huddle01/huddle01-client v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Huddle01 Client SDK

https://huddle01-assets-frontend.s3.amazonaws.com/general/huddle01-logo-blue.svg

NOTE: Request for access to the huddle01-client pkg on Huddle01's discord or reach out to the team.

Quick Start

Install the huddle01-client pkg from npm or yarn

Installation

# npm
npm i @huddle01/huddle01-client

# yarn
yarn add @huddle01/huddle01-client

Import

import HuddleClientProvider and getHuddleClient from the npm pkg

// HuddleIframe to be imported
import {
  HuddleClientProvider,
  getHuddleClient,
} from '@huddle01/huddle01-client';

Configure

Configure huddleClient by passing your API key

NOTE: If API key is not passed your app will be rate limited and might not work.

const huddleClient = getHuddleClient(apiKey);

Wrap providers

Wrap your application with HuddleClientProvider

Wrapping you provider inside the HuddleClientProvider gives you access to the huddleClient instance to control your huddle01 powered app.

It is similar to the Context Provider given by React. Read more in React Docs

// JavaScript | TypeScript
const App = () => {
  return (
    <HuddleClientProvider value={huddleClient}>
      <YourApp />
    </HuddleClientProvider>
  );
};

Usage

These hooks are similar to any other react hook like useEffect or useState, You can read about these hooks in the React Docs

// JavaScript | TypeScript
import { useHuddleClientContext } from '@huddle01/huddle01-client/hooks';

const huddleClient = useHuddleClientContext();

// Example
huddleClient.muteMic();

💡 For any help reach out to us on Discord