Installation
Install the Native Frame client for your stack
To install the Native Frame client, pick the package that matches your stack and add it with npm, yarn, or the CDN. Use @video/video-client-react in a React application — it ships the hooks, context providers, and components. Use @video/video-client-core for vanilla JavaScript or any non-React framework. Use @video/react-native-sdk in a React Native app. This guide gets the client installed and confirms it loads; building a broadcaster and a viewer is the Quickstart.
Prerequisites
Before you install, you need:
- Node.js 14 or later with npm or yarn, if you install from the registry
- React 17 or later, if you use the React package — hooks are required
- A browser from Chrome 74+, Firefox 68+, Safari 12.1+, or Edge 79+
- HTTPS on any site that captures camera or microphone, except on
localhost
Credentials are not needed to install the client, but you need them before it can connect to anything. Get your authentication token, stream key, and backend endpoint from Create an account and get credentials.
Install
Which package you install depends on your framework, so start there.
React Native apps install @video/react-native-sdk from the @video registry. The SDK needs React Native 0.78.0 or later, React 18.2.0 or later, iOS 15.1 or later, and Android API 24 or later. Point the @video scope at the registry in your .npmrc (npm and Yarn 1):
@video:registry=https://npm-packages.nativeframe.com/
All brands install from the shared Native Frame registry (npm-packages.nativeframe.com), including on Generflow and LivelyVideo sites. Use it exactly as shown.
Yarn 2 and later read the scope from .yarnrc.yml instead:
npmScopes:
video:
npmRegistryServer: https://npm-packages.nativeframe.com/
Then add the SDK and its five peer packages with yarn:
yarn add @video/react-native-sdk
yarn add react-native-video@6.19.0 \
react-native-webrtc@124.0.6 \
@react-native-picker/picker@2.11.1 \
react-native-safe-area-context@5.5.1 \
react-native-screens@4.16.0
Or with npm:
npm install @video/react-native-sdk
npm install react-native-video@6.19.0 \
react-native-webrtc@124.0.6 \
@react-native-picker/picker@2.11.1 \
react-native-safe-area-context@5.5.1 \
react-native-screens@4.16.0
pnpm works the same way with pnpm add. On iOS, link the native modules before you build:
cd ios && pod install
The SDK links against these exact peer versions. Install every one of them at the version shown; a different version, or a missing package, fails at native link time rather than at install time.
From the CDN
The CDN serves @video/video-client-core only, so this path is for vanilla JavaScript and non-React frameworks. There is nothing to install and no build step — load the client with an import map:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Native Frame App</title>
<script type="importmap">
{
"imports": {
"vdc-cdn": "https://cdn.nativeframe.com/video-client-core/14.0.0/index.js"
}
}
</script>
</head>
<body>
<div id="app"></div>
<script type="module">
import { createCall, BaseAuthClient } from 'vdc-cdn';
// Your code here
</script>
</body>
</html>
The version is part of the CDN path, so a page stays pinned to whatever version its import map names. Change that segment of the path to move to another release. The path also accepts latest, but it moves under you without a deploy on your side — do not point production at it.
Import maps require Chrome 89+, Firefox 108+, Safari 16.4+, or Edge 89+. To support anything older, install from the registry and use a bundler instead.
Verify
Render this component in your app. If it compiles and you see your camera preview, the React package is installed and working:
import React from 'react';
import { usePreviewPlayer } from '@video/video-client-react/hooks';
import { MediaStreamControllerAPIProvider, PlayerAPIProvider } from '@video/video-client-react/context';
import { Video } from '@video/video-client-react/components';
export default function VerifyInstallation() {
const { mediaStreamController, previewPlayer, isLoading } = usePreviewPlayer();
if (isLoading) {
return <div>Loading camera...</div>;
}
return (
<MediaStreamControllerAPIProvider mediaStreamController={mediaStreamController}>
<PlayerAPIProvider player={previewPlayer}>
<Video />
</PlayerAPIProvider>
</MediaStreamControllerAPIProvider>
);
}
Your browser prompts for camera access the first time it runs. Connecting to a real stream needs your credentials and is covered in the Quickstart.
Serve this page over HTTP and open it. If the status line reports the client loaded and your camera preview appears, the core package is installed and working:
<!DOCTYPE html>
<html lang="en">
<head>
<script type="importmap">
{
"imports": {
"vdc-cdn": "https://cdn.nativeframe.com/video-client-core/14.0.0/index.js"
}
}
</script>
</head>
<body>
<div id="status">Checking installation...</div>
<div id="preview"></div>
<script type="module">
import { mediaController, requestPlayer } from 'vdc-cdn';
const status = document.getElementById('status');
status.textContent = 'Client loaded.';
try {
await mediaController.init();
const msc = await mediaController.requestController();
const player = await requestPlayer({ mediaStreamController: msc, muted: true });
const video = document.createElement('video');
video.style.width = '640px';
video.style.height = '480px';
document.getElementById('preview').appendChild(video);
player.attach(video);
status.textContent = 'Installation verified. Camera preview appears below.';
} catch (error) {
status.textContent = 'Client loaded, but camera access failed: ' + error.message;
console.error(error);
}
</script>
</body>
</html>
If the import fails, the page logs a module-resolution error instead — see Troubleshooting below.
Render this component in your app. If it builds and the player mounts without a native-module error, the SDK and its peer packages are installed and linked:
import React from 'react';
import { View } from 'react-native';
import { VideoPlayer, getSession } from '@video/react-native-sdk';
export default function VerifyInstallation() {
const session = getSession({
backendEndpoint: '<your backend endpoint>',
displayName: 'Verify install',
streamName: 'verify-install',
});
return (
<View style={{ flex: 1 }}>
<VideoPlayer
manifestUrl="<manifest URL>"
session={session}
style={{ backgroundColor: '#000' }}
/>
</View>
);
}
The player stays blank until you give it a real manifest URL and backend endpoint, so a blank player with no error is the pass condition here. Connecting to a real stream needs your credentials, and the camera and microphone permissions your app has to declare; both are covered in the Quickstart.
Troubleshooting
Cannot find module '@video/video-client-react'
The package is not installed, or npm cannot reach the shared @video registry.
- Confirm the package is installed:
npm list @video/video-client-react - Confirm your
.npmrcpoints the@videoscope at the shared@videoregistry - Reinstall from scratch:
rm -rf node_modules && npm install - Clear the npm cache:
npm cache clean --force - Check that the package is listed under
dependenciesinpackage.json
Browser does not support import maps
The CDN method needs a browser that understands import maps.
- Update to Chrome 89+, Firefox 108+, Safari 16.4+, or Edge 89+
- Or install from the registry and use a bundler, which needs no import-map support
- An import-map polyfill also works, but do not depend on one in production
TypeScript reports errors on Native Frame types
Both packages ship their own definitions, so type errors usually mean your compiler options do not match them.
- Update to the current package version:
npm update @video/video-client-react - Set
moduleResolution: "node",esModuleInterop: true, andallowSyntheticDefaultImports: trueintsconfig.json; React projects also needjsx: "react" - Restart the TypeScript server in your editor
skipLibCheck: truesilences the errors as a temporary workaround, not a fix
A bundler cannot resolve the package
Vite resolves both packages with no extra configuration. Webpack and Rollup need ES-module resolution set up: add .js, .ts, and .tsx to Webpack's resolve.extensions, or add @rollup/plugin-node-resolve and @rollup/plugin-commonjs to a Rollup build.
If none of these fix it, the Troubleshooting guide and the FAQ cover more cases.
When you contact Native Frame support, include your Node and npm versions (node -v && npm -v), the installed package version (npm list @video/video-client-react), the full error and stack trace, and your browser and operating system.