Skip to main content
SDK · ReactStable · v6.1.07 min readUpdated Jun 2

Rewarded video in React & React Native.

The AppLixir SDK is the same single <script> for every framework — there is no npm package and no native module. This guide shows the idiomatic way to call it from a React web app (a reusable hook + component), the framework recipes for Vite, Next.js, and CRA, and the one rule that makes a React Native integration actually fill.

Typical CPM
$4+/mille
8× standard display
Integration
1 hook
zero dependencies
Fill rate · avg.
94%
across 31 partners

The SDK is a browser SDK: it needs a real page origin, cookies, and a working TCF consent handshake. In React web you already have all three. In React Native you get them only when the WebView loads a real https:// URL — that is the single most common reason ads fail to fill on mobile, and it has its own step below.

What's new in v6.1

Server-side header bidding runs on every impression — a real-time auction across our demand stack before any ad-server fallback. Existing integrations get the CPM lift by pinning the SDK URL to v6.1.0.

What you'll build

  1. Load the SDK once

    A single CDN script exposes window.initializeAndOpenPlayer. Add it in index.html or let the hook inject it.

  2. Wrap it in a hook

    useRewardedAd returns a ready flag and a showAd() promise that resolves only when the user watched the ad through.

  3. Trigger from a user gesture

    Open the player on a click or tap. Browsers block ads that aren't user-initiated.

  4. Grant rewards from your server

    Use the local complete event for optimistic UI; let the server-side web callback be the source of truth for persistent rewards.

Pick your path

tip

Already know React? The Quick start gets you to a working ad in about three minutes.

Examples & AI prompts on GitHub

Prefer to copy working code — or have an AI agent do the integration for you?

Live status
Ad server● 99.98%
Dashboard● 100%
Reporting● 99.95%
Avg CPM$11.40