New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-twitch-player

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-twitch-player

Drop-in component to play Twitch videos in React

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

React Twitch Player

An easy drop-in Twitch VOD player in React. I used this for a different project because there was nothing else available which let you access the player element.

Installation

Install via npm:

npm install react-twitch-player

Usage

Usage is extremely simple:

  • Import both the useTwitch hook and TwitchPlayer component
import {useTwitch, TwitchPlayer} from "react-twitch-player";
  • Initialize the player by using the useTwitch hook. Make sure to pass in the ID of the Twitch VOD you'd like to play.
const player = usePlayer('2505966283')
  • Add the TwitchPlayer component to your JSX (it optionally takes any props that you could pass in a div).
...
<TwitchPlayer />
...

Example

Basic example of how to use it:

import React from "react";
import {useTwitch, TwitchPlayer} from 'react-twitch-player';

function MyPlayer() {
    const player = useTwitch('2505966283');

    return (
        <TwitchPlayer />
    )
}

Keywords

react

FAQs

Package last updated on 08 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts