PatternsReal-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

    Install from the preview toolbar

    Shadcn Icon

    Copy the install command above and run it in your project — Pro patterns include a short-lived token.

  2. 2

    Add environment variables to .env.local

    FIRECRAWL_API_KEY, AI_GATEWAY_API_KEY

  3. 3

    Point client fetches at your API routes

    Replace preview `/view/.../api/...` paths with `/api/...` in the installed files.

  4. 4

    Customize the agent and tool files

    Adapt prompts, tools, and stop conditions for your product — Copy for AI in the toolbar helps seed that work.

  5. 5

    Run your dev server and open the pattern route

    Install dependencies if needed, then start the app 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