You can use our client (frontend) SDKs to easily implement Pipe into your product.
@onehop/client
: The core library used by all other framework-specific
packages. Can also be used independently.@onehop/react
: Our React-specific implementations for Pipe and Channels.
init
function outside of a React component. For example,
in your application’s entrypoint file:
@onehop/react
package exposes a collection of React hooks which allow you
to easily implement product features into your app. We’ll focus on usePipeRoom
in this section.
usePipeRoom
usePipeRoom
takes in an object as it’s first and only argument, consisting of
joinToken
and ref
, where ref
is a
React reference to a video element.
Let’s jump into an example bare-minimum component:
usePipeRoom
returns the following object:
field | type | description |
---|---|---|
live | boolean | whether the current room is live or offline |
canPlay | boolean | whether the room is able to play the stream |
susbcription | string | one of: available, unavailable, non_existent |