@livuvo/live-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Livuvo Live Service Documentation

Introduction

Welcome to the documentation for the @livuvo/live-sdk library. This library facilitates seamless integration of your React application with the Livuvo live service. The provided LivuvoLiveSDK component enables you to connect to livuvo server and render Live and Chat features.

Installation

You can install this package using npm:

npm install @livuvo/live-sdk

or yarn:

yarn add @livuvo/live-sdk

Usage

follow these steps:

  1. Import the SDK:
import { LivuvoLiveSDK } from "@livuvo/live-sdk";
  1. import styles:
import "@livuvo/live-sdk/style.css";
  1. Fetch the configuration data from below API endpoint: https://neo.livuvo.com/authnz/api/v1/user-token/[SPACE-SLUG]/live/[LIVE-SLUG]/

  2. Initialize the configuration and render the LivuvoLiveSDK component:

const fetchedConfig = ...;

<LivuvoLiveSDK  config={fetchedConfig} />

Components

LivuvoLiveSDK

Props

  • config (required): An object containing the configuration data for the Live SDK. It should follow the Config interface.
interface Config {
  display_name: string;
  session: string;
  space_slug: string;
  token: string;
  user_id: string;
  scope: string;
  slug: string;
  is_blocked: boolean;
}
  • isDesktop (optional): A boolean flag indicating whether the app is running in desktop mode or mobile mode. Default value is false.

Conclusion

This library simplifies the integration of your React application with the Livuvo live service. By following the steps outlined in this documentation, you can quickly set up the LivuvoLiveSDK component.

Endpoint description

The endpoint URL for fetching user tokens is: https://neo.livuvo.com/authnz/api/v1/user-token/[SPACE-SLUG]/live/[LIVE-SLUG]/

It's important to note that this endpoint should be accessed from the backend due to security considerations. This is because you need to provide a confidential Authorization token (Authorization header) as part of the request. To obtain an API token, follow these steps:

  1. Visit app.livuvo.com.
  2. Navigate to the space settings page.
  3. In the "API Tokens" section at the bottom, you can generate a new API token.
  4. Set obtained api token as Authorization header.

When making a request to the endpoint, include the following object in the request body: This object should be sent as part of the POST request to the specified URL.

{
  "user_id": "USER_ID",
  "display_name": "DISPLAY_NAME",
  "chat": "rw"
}

Please ensure that you handle this sensitive information securely and follow best practices for API token management.

Readme

Keywords

none

Package Sidebar

Install

npm i @livuvo/live-sdk

Weekly Downloads

1

Version

0.0.1

License

none

Unpacked Size

2.17 MB

Total Files

20

Last publish

Collaborators

  • amirkabiri
  • salarmgh