@caast/react-use-caast
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published
caast.tv

Install

yarn add @caast/react-use-caast
# or
npm i @caast/react-use-caast --save

Description

This hook allow you to simply implement Caast library on a React project. It will inject the library in your DOM with your provided API keys. The caast instance will then be available in order to perform the available actions of the library.

Usage

import React, { useState, useEffect } from 'react';
import useCaast from '@caast/react-use-caast';

export default function App() {
  const caastInstance = useCaast({ app_id: 'MY_APP_ID', app_key: 'MY_APP_KEY' });

  useEffect(() => {
    if (caastInstance) {
      console.log('Caast is now loaded, you can now call Caast library methods', caastInstance.infos());
    }
  }, [caastInstance]);
}

Readme

Keywords

Package Sidebar

Install

npm i @caast/react-use-caast

Weekly Downloads

4

Version

1.0.2

License

ISC

Unpacked Size

7.5 kB

Total Files

9

Last publish

Collaborators

  • peacepostman