> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Get started building with Livepeer UI Kit!

> [!NOTE]
>
> These docs are written for a React or React Native developer building on
> `@livepeer/react` or `@livepeer/react-native`.

## Installation

Install Livepeer React using your favorite package manager.

> [tab] React
>
> ```
> npm i @livepeer/react
> ```

> [tab] React Native
>
> React Native also requires some peer dependencies (used in the `Player`
> component). We rely on `expo` for pod installation/linking. You must ensure that
> the
> [correct version of `react-native-svg`](https://github.com/software-mansion/react-native-svg#supported-react-native-versions)
> is installed.
>
> If you're installing this in a
> [bare React Native app](https://docs.expo.dev/introduction/managed-vs-bare/#bare-workflow),
> you should also follow the
> [extra `expo-av` installation instructions](https://github.com/expo/expo/tree/sdk-47/packages/expo-av).
>
> ```bash React Native theme={null}
> expo install @livepeer/react-native expo-av react-native-svg
> ```

## Create a livepeer client

First, create a livepeer `Client` instance using
[`createReactClient`](/sdks/react/migration/3.x/client), and pass a provider to
it.

> [tab] React
>
> ```tsx theme={null}
> import { createReactClient, studioProvider } from '@livepeer/react';
>
> const client = createReactClient({
>   provider: studioProvider({ apiKey: 'yourStudioApiKey' }),
> });
> ```

> [tab] React Native
>
> ```tsx theme={null}
> import { createReactClient, studioProvider } from '@livepeer/react-native';
>
> const client = createReactClient({
>   provider: studioProvider({ apiKey: 'yourStudioApiKey' }),
> });
> ```

Note: If you choose to use Studio as a provider, you will need to configure an
API key for the `studioProvider` which is
[CORS-protected API key](/sdks/react/migration/3.x/providers/studio#apikey).

[Read more about client configuration](/sdks/react/migration/3.x/client.md)

## Wrap app with `LivepeerConfig`

Next, wrap the app with the
[`LivepeerConfig`](/sdks/react/migration/3.x/LivepeerConfig) component, passing
the `client` to it.

> [tab] React
>
> This is added to `_app.js` for Next.js or `App.js` with Create React App, so that the
> `LivepeerConfig` React Context is available across every component.
>
> ```tsx theme={null}
> import {
>   LivepeerConfig,
>   createReactClient,
>   studioProvider,
> } from '@livepeer/react';
>
> const client = createReactClient({
>   provider: studioProvider({ apiKey: 'yourStudioApiKey' }),
> });
>
> function App() {
>   return (
>     <LivepeerConfig client={client}>
>       <SomeComponent />
>     </LivepeerConfig>
>   );
> }
> ```

> [tab] React Native
>
> This is added to `App.js`, so that the `LivepeerConfig` React Context is available across every component.
>
> ```tsx theme={null}
> import {
>   LivepeerConfig,
>   createReactClient,
>   studioProvider,
> } from '@livepeer/react-native';
>
> const client = createReactClient({
>   provider: studioProvider({ apiKey: 'yourStudioApiKey' }),
> });
>
> function App() {
>   return (
>     <LivepeerConfig client={client}>
>       <SomeComponent />
>     </LivepeerConfig>
>   );
> }
> ```

## Enjoy!

Use hooks! Every component inside the `LivepeerConfig` is now set up to use the
livepeer hooks.

> [tab] React
>
> ```tsx theme={null}
> import { useAsset } from '@livepeer/react';
>
> function SomeComponent() {
>   const asset = useAsset({ assetId: 'd8e8b87d-6774-4083-a2d7-4e85872d18cd' });
>
>   return <div>Asset: {asset.name}</div>;
> }
> ```

> [tab] React Native
>
> ```tsx theme={null}
> import { useAsset } from '@livepeer/react-native';
>
> function SomeComponent() {
>   const asset = useAsset({ assetId: 'd8e8b87d-6774-4083-a2d7-4e85872d18cd' });
>
>   return <div>Asset: {asset.name}</div>;
> }
> ```

Want to learn more? Continue reading the documentation for more details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.