Skip to main content
@vouchmark/widget-react provides a drop-in React component with full TypeScript types. It manages script loading, lifecycle callbacks, and cleanup automatically.

Installation

Quick start

The component renders a styled button by default. When clicked, it opens the widget overlay.

Props

Custom trigger

Pass any React element as the trigger prop to replace the default button:

Imperative control with useVouchmark

For programmatic open/close without rendering a trigger:

TypeScript types

Next.js App Router

The widget component is a client component. Use it inside a "use client" boundary:

Server-side session creation

For signed sessions, create the token on the server and pass it as a prop: