Integration Guide
Background
Please make sure you are familiar with the Architecture Overview before proceeding with this integration.
Prerequisites
System Requirements
- Node.js / JavaScript or TypeScript environment
- React application
Supported Platforms
This SDK supports TV applications on:
- LG WebOS
- Samsung Tizen
- Hisense VIDAA OS
- Xbox
Obtain an SDK API Key
You need an SDK API key to integrate StreamLayer into your application.
If you don't have one:
- Provide your email to StreamLayer support.
- We'll create an organization and set up your dashboard.
- You'll receive an invitation email with admin panel credentials.
- After accessing the admin panel, generate your API key from the Developer Settings section.
This API key authenticates your app and is required for all SDK interactions.
Installation
Install the @streamlayer/web-os dependency:
npm install @streamlayer/web-osAdding Styles
-
Import in your app:
import '@streamlayer/web-os/style.css'
Integration
Basic Terminology
- SDK Key: Organization-specific identifier that authenticates your app.
- Event ID: Unique identifier for the event you want to interact with.
- StreamLayerProvider: React component that initializes the SDK and provides context.
- StreamLayerSDKTv: Main interactive UI
Introduction
StreamLayerProvider is the main entry point.
It initializes the SDK and configures it via its props.
Place and Configure StreamLayer
Wrap only the parts of your app that require StreamLayer features.
Important:
- Only one
StreamLayerProvideris allowed in your app.- Do not use CSS to hide or show
StreamLayerProvider. Use conditional rendering based on state or props.- The SDK core initializes once when
StreamLayerProvidermounts and destroys on unmount.- Initialization loads required resources. For a smooth experience, render
StreamLayerProviderin advance.
Example:
import { StreamLayerProvider, StreamLayerSDKTv } from '@streamlayer/web-os'
import '@streamlayer/web-os/style.css'
export const Main = () => (
<StreamLayerProvider sdkKey="your-sdk-key" event="your-event-id">
<StreamLayerSDKTv>
<video />
</StreamLayerSDKTv>
</StreamLayerProvider>
)Platform-Specific Considerations
For platform-specific notes and testing tips, see:
Next Steps
- Exposed Pause Ad – Learn how to implement pause ad functionality
- Split Components – Use individual components for custom UI layouts
Updated 2 days ago
What’s Next
