TemplatesReal-world Examples

Firecrawl Brand PDF

Loading pattern preview

Problems solved

Technical challenges this implementation handles out of the box.
  • Generate structured brand brief PDFs from a website URL
  • Extract branding, markdown, and screenshot context with Firecrawl
  • Stream PDF sections through JSON Render
  • Organize token candidates and implementation recommendations

Use cases

Products and workflows this pattern is designed to support.
  • Founder launch brand briefs
  • Design system baseline analysis
  • Brand consistency audit PDFs
  • Agency brand intake reports

Setup

Requirements, wiring steps, and what this pattern adds to your project.

Getting started

Pick how you want to pull this pattern in. Then wire env vars and routes the same way.

  1. 1

    Download → Next.js app

    Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).

  2. 2

    Extract the zip and install dependencies

    Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.

  3. 3

    Fill .env.local

    The download includes .env.local placeholders when needed. Add real values for: FIRECRAWL_API_KEY, AI_GATEWAY_API_KEY.

  4. 4

    Customize the agent and tool files

    Adapt prompts, tools, and stop conditions in the generated project for your product.

  5. 5

    Run the app and open the pattern route

    Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.

Environment variables

Capabilities

AI SDK APIs

streamTextgateway

Providers

Gemini

External services

FirecrawlUpstash

Files added

12 files
  • app/page.tsx
  • app/layout.tsx
  • app/api/firecrawl-brand-pdf-generate/route.ts
  • app/api/pdf/route.ts
  • app/api/pdf/brand-pdf-document.tsx
  • lib/catalog.ts
  • lib/examples.ts
  • lib/branding-types.ts
  • lib/font-mapping.ts
  • lib/firecrawl-cache.ts
  • lib/rate-limit.ts
  • README.md

Dependencies

17 total

npm packages

12
@json-render/core@json-render/react-pdf@mendable/firecrawl-js@react-pdf/renderer@resvg/resvg-jsUpstashAISDKlucide-reactmotionNext.jsReactZod

Shadcn IconRegistry components

5
buttonemptyresizablesheettextarea

Critical files

  • firecrawl-brand-pdf-generate/route.ts

    Core pipeline: URL validation, Firecrawl scrape (branding/markdown/screenshot), context normalization, and streamed JSON Render PDF generation.

  • components/firecrawl-brand-pdf-demo.tsx

    Three-pane UI for prompting, live JSON spec, and PDF preview with download flow.

Requirements

Complexity
Advanced
Setup time
~8 minutes
Node
24+
Memory
256MB
Upstash Redis