Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sidecar Browsershot Laravel Package

wnx/sidecar-browsershot

Run Spatie Browsershot on AWS Lambda via Sidecar in Laravel. Generate PDFs/screenshots without installing Node, Puppeteer, or Chrome on your server—headless Chrome runs in a deployed Lambda function. Includes config publishing and Sidecar deploy workflow.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Serverless PDF/HTML Rendering: Enables generating PDFs or screenshots of web pages directly in AWS Lambda, reducing infrastructure complexity for dynamic document generation (e.g., invoices, reports, or marketing assets).
  • Cost Optimization: Avoids long-running EC2 instances or managed services (e.g., AWS Lambda + external APIs) by bundling Browsershot (a headless Chrome/Chromium tool) into a lightweight, ephemeral function.
  • Roadmap for Scalable Media: Supports features like:
    • On-demand PDF generation for user-uploaded content (e.g., "Download as PDF" buttons).
    • Batch processing of web pages (e.g., crawling + archiving).
    • A/B testing tools requiring dynamic screenshot comparisons.
  • Build vs. Buy: Replaces custom Lambda layers or third-party APIs (e.g., Puppeteer, Playwright) with a maintained, PHP-native solution, reducing vendor lock-in.
  • Use Cases:
    • E-commerce: Generate product catalog PDFs.
    • SaaS: Automated compliance reports (e.g., GDPR data exports).
    • Internal Tools: Convert web dashboards to shareable PDFs.

When to Consider This Package

  • Adopt if:
    • Your PHP stack already uses Laravel or Symfony, and you need headless Chrome capabilities in Lambda.
    • You prioritize cost efficiency over managed services (e.g., AWS Lambda + external APIs like Browserless).
    • Your use case fits Lambda’s 15-minute timeout and ephemeral storage constraints (e.g., small-to-medium PDFs).
    • You want to avoid CORS or rate-limiting issues with third-party screenshot APIs.
  • Look elsewhere if:
    • You need long-running tasks (>15 mins) or large file processing (consider ECS/Fargate or Step Functions).
    • Your team lacks PHP expertise but has strong Node.js/Python skills (e.g., prefer Puppeteer or Playwright).
    • You require advanced Chromium features (e.g., geolocation, device emulation) not supported by this wrapper.
    • Compliance mandates on-premise rendering (e.g., highly sensitive data).

How to Pitch It (Stakeholders)

For Executives: "This package lets us generate PDFs/screenshots of web pages directly in AWS Lambda—cutting costs by ~50% vs. third-party APIs and eliminating the need for dedicated servers. It’s ideal for scaling features like ‘Download as PDF’ or automated reports without hiring DevOps to manage infrastructure. MIT-licensed and maintained, it’s a low-risk way to add serverless media processing to our PHP stack."

For Engineering: *"wnx/sidecar-browsershot wraps Browsershot in a Lambda-friendly Sidecar function, solving our pain point of [X]. Key benefits:

  • No external dependencies: Self-contained Chromium in Lambda (avoids API latency/errors).
  • Laravel-native: Integrates seamlessly with queues/jobs (e.g., SidecarBrowsershot::pdf($url)).
  • Cost-effective: Pay-per-use for sporadic workloads (vs. always-on services). Tradeoff: Limited to Lambda’s constraints (e.g., 10GB ephemeral storage). For heavy lifting, we’d pair this with S3 for large files or ECS for long tasks."*

For Design/UX: *"This enables dynamic PDF generation for [feature], like turning user-created content into shareable documents. For example:

  • Invoices: Auto-generate PDFs from order data + embedded web previews.
  • Marketing: Create on-demand ‘save as PDF’ for landing pages. No more manual exports—just a button click."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests