Use @markpdf/react when you want React hooks and upload progress in a controlled client-side app. For public production apps, prefer calling your own backend so the private API key stays server-side.
import { MarkpdfProvider } from "@markpdf/react";export function App() { return ( <MarkpdfProvider apiKey="YOUR_API_KEY"> <YourUploader /> </MarkpdfProvider> );}
A key used directly in React is visible in the browser. Use this only for prototypes, internal tools, or restricted public keys. For Next.js, use @markpdf/nextjs.