react-pdf-kit-setup — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited react-pdf-kit-setup (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when: the developer asks to add a PDF viewer using @react-pdf-kit/viewer to a React project, AND the project is not specifically Next.js or Vite. For those, prefer the framework-specific skills.
@react-pdf-kit/viewer builds on PDF.js and renders PDFs through a nested provider chain. Treat the chain as the canonical composition model. Everything else (theming, layout, hooks) layers onto it.
@react-pdf-kit/viewer. Do NOT install pdfjs-distseparately.** In v2, pdfjs-dist is an auto-installed peer dependency pinned to a default version (5.4.530). You install pdfjs-dist yourself ONLY when deliberately overriding that version, which is covered by react-pdf-kit-worker-config.
set up automatically. Do NOT set GlobalWorkerOptions.workerSrc or pass a workerUrl. Custom worker URLs are only needed when overriding pdfjs-dist; see react-pdf-kit-worker-config.
also wraps theming internally, so a separate RPTheme is optional.
runs in free/trial mode (a watermark is shown). Pass <RPConfig licenseKey="..."> for licensed/commercial use.
stylesheet.
RPLayout for everynew integration.
pnpm add @react-pdf-kit/viewer(Use npm install, yarn add, or bun add if not on pnpm.) Nothing else is required; pdfjs-dist is pulled in automatically.
RPConfig at the app rootRPConfig must be rendered once at the root of your application. It handles worker setup and theming for every viewer instance below it.
// src/App.tsx
import { RPConfig } from '@react-pdf-kit/viewer'
import { PdfViewer } from './PdfViewer'
export function App() {
return (
<RPConfig>
<main style={{ height: '100vh' }}>
<PdfViewer src="/sample.pdf" />
</main>
</RPConfig>
)
}For explicit theme control, pass customVariables / customDarkVariables to RPConfig (or nest an RPTheme).
// src/PdfViewer.tsx
import {
RPProvider,
RPLayout,
RPPages,
} from '@react-pdf-kit/viewer'
export function PdfViewer({ src }: { src: string }) {
return (
<RPProvider src={src}>
<RPLayout toolbar>
<RPPages />
</RPLayout>
</RPProvider>
)
}RPLayout's toolbar prop renders the default toolbar. The viewer adapts to its container, so give the parent a definite height (100vh or fixed) for virtual scrolling to work. You can also size it directly via RPLayout's style prop.
pnpm install
pnpm build
pnpm devOpen the dev server URL. The first PDF page should render with the default toolbar visible. Scroll down. Additional pages mount as you scroll (virtualization at work). Selecting text should produce a real text selection, not a canvas-only image.
react-pdf-kit-nextjs-app-router for Next.js App Router projects.react-pdf-kit-vite for Vite projects.react-pdf-kit-worker-config for overriding the pdfjs-distversion and configuring a custom worker URL.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.