App Router: keep next/script and reaction-video in a "use client" boundary for ReactionSDK overlays (tap, poll, rating, slider, and CTA).
For ReactifySDK (threads + in-page recorder popup), see ReactifySDK Next.js installation.
1) Env (production analytics)
.env.local
# .env.local
NEXT_PUBLIC_REACTION_API_KEY=rsk_live_your_key
NEXT_PUBLIC_REACTION_ACCOUNT_ID=your_account_id2) Client embed
Omit keys for zero-config demo. With keys, call Reactify.init on script onLoad.
ReactionVideoEmbed.tsx
// components/ReactionVideoEmbed.tsx
"use client";
import Script from "next/script";
const SRC = "https://reactify-cdn.s3.us-east-2.amazonaws.com/sdk.js?v=2.0.8";
const APP_BASE = "https://api.reactionsaas.com";
declare global {
interface Window {
Reactify?: {
init: (opts: Record<string, unknown>) => void;
};
}
}
export function ReactionVideoEmbed() {
const apiKey = process.env.NEXT_PUBLIC_REACTION_API_KEY ?? "";
const accountId = process.env.NEXT_PUBLIC_REACTION_ACCOUNT_ID ?? "";
return (
<>
<Script
src={SRC}
strategy="afterInteractive"
onLoad={() => {
if (!apiKey.trim()) return;
window.Reactify?.init?.({
apiKey,
accountId,
baseUrl: APP_BASE,
mode: "production",
allowedOrigins: [window.location.origin],
});
}}
/>
{/* @ts-expect-error custom element */}
<reaction-video
src="https://yourcdn.com/video.mp4"
overlays="tap,poll,slider,rating"
poll-question="Which style do you prefer?"
cta-text="Buy Now"
overlay-position="bottom-center"
interaction-type="tap"
/>
</>
);
}Server page
// app/page.tsx (Server Component)
import { ReactionVideoEmbed } from "@/components/ReactionVideoEmbed";
export default function Page() {
return <ReactionVideoEmbed />;
}3) Configure overlays
Run in Playground
<reaction-video src="video.mp4" overlays="tap,poll,rating,slider,cta" cta-text="Buy Now" interaction-type="rating"></reaction-video>Try this config in the Playground.
4) View analytics dashboard
Open the dashboard to see impressions, interactions, and engagement analytics.
Try it live
Preview overlay interactions on a sample video (same demo as the docs playground).
Rate:
ReactionSDK demo