Getting Started
Get started with the StreamLayer Web SDK. Install, configure, and integrate interactive features into your web application.

Welcome to the StreamLayer Web SDK documentation. This guide covers everything you need to integrate StreamLayer into your web application.
Start with your AI coding assistant
Connect your assistant to StreamLayer docs before changing code, then use this prompt. The connection lets it search the current guides and read the platform integration skill as it works.
Help me integrate StreamLayer into my existing browser React app using @streamlayer/react.
Use the streamlayer-docs MCP to search for and fetch the matching integration
guide and the streamlayer-web-integration skill page before editing code.
If search does not return the skill, read https://docs.streamlayer.io/docs/web-sdk-integration-skill
or ask me to copy that page into this session.
Cite the sources, confirm my SDK version and prerequisites, and make the smallest
documented change while preserving my player and app structure. Report missing
or conflicting guidance instead of guessing. Use placeholder keys in examples.
Finish with the checks run and the remaining platform/device validation steps.Review the diff and follow the platform setup and testing guidance linked below.
Quick Start Path
- Read the Introduction — Understand what StreamLayer delivers and how the SDK architecture works.
- Follow the Integration Guide — Step-by-step setup: npm install, SDK API Key, initialization, and component placement.
- Try a Test Integration — Validate your setup with ads and in-play game features.
- Explore Sample Integrations — Fully functional reference projects.
Module Formats
@streamlayer/react ships as a dual-format package — ESM and CJS:
| Format | Condition | Target | Path |
|---|---|---|---|
| ESM | import / module | esnext | lib/es/*.js |
| CJS | default / require | ES2015 (Chrome 32+) | lib/cjs/*.js |
// ESM — esnext, modern syntax
import { StreamLayerProvider } from '@streamlayer/react'
// CJS — ES2015, transpiled with Babel for older environments
const { StreamLayerProvider } = require('@streamlayer/react')Classic (/classic)
/classic)The /classic entry point is a mirror of the default exports — it resolves to the same files. It exists for backward compatibility with integrators already using /classic import paths:
// These are equivalent:
import { StreamLayerProvider } from '@streamlayer/react'
import { StreamLayerProvider } from '@streamlayer/react/classic'Polyfills
The SDK provides an optional polyfills bundle for environments that lack modern browser APIs. Import it once at the top of your application entry point, before any SDK imports:
import '@streamlayer/react/polyfills'The polyfill packages are listed as peer dependencies — install only the ones you need:
pnpm add core-js regenerator-runtime text-encoding-utf-8 \
intersection-observer resize-observer-polyfill \
web-streams-polyfill whatwg-fetch abortcontroller-polyfillNote: If your application already polyfills these APIs (e.g., via
@babel/preset-envwithuseBuiltIns), you may not need the polyfills bundle at all.
Styles
Import the SDK stylesheet in your application:
import '@streamlayer/react/style.css'This is required for all visual SDK components to render correctly.
What You Can Build
| Feature | Component | Guide |
|---|---|---|
| Gamification UI | StreamLayerSDKReact | Gamification UI |
| Dynamic Advertising | StreamLayerSDKAdvertisement | Advertisement |
| Host-Provided VAST Ads | StreamLayerSDKAdvertisement (externalAdData) | External VAST Ads |
| Pause Ads | StreamLayerPauseAd | Pause Ads |
| Notifications | StreamLayerSDKNotification | Notifications |
| Gamification Points | StreamLayerSDKPoints | Points |
| Insight Unit | StreamLayerSDKInsight | Insight |
| Authentication | Auth Forwarding | Authentication |
| Deep Linking | Invite Links | Deep Links |
| Custom Themes | Dark Mode & Branding | Theme |
| Video Control | videoPlayerController | Video Controller |
| Flexible UI | useStreamLayerUI | UI Context |
| SDK Core API | useStreamLayer | SDK Context |
System Requirements
- React 17+
- Node.js 18+
- npm or yarn
Support
- Email: [email protected]
- Slack: Integration partners can join our real-time support channel for engineering assistance.
- NPM Package: @streamlayer/react
Related
- Integration Guide — Complete SDK setup and configuration
- Test Integration: Ads + Games — Quick-start example with ads and games
- Sample Integrations — Fully functional reference projects
Updated 25 days ago
