Download the PHP package hcancelik/sidecar-browsershot without Composer
On this page you can find all versions of the php package hcancelik/sidecar-browsershot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hcancelik/sidecar-browsershot
More information about hcancelik/sidecar-browsershot
Files in hcancelik/sidecar-browsershot
Package sidecar-browsershot
Short Description A Sidecar function to run Browsershot on Lambda.
License MIT
Homepage https://github.com/hcancelik/sidecar-browsershot
Informations about the package sidecar-browsershot
Run Browsershot on AWS Lambda with Sidecar for Laravel
This package allows you to run Browsershot on AWS Lambda through Sidecar.
You won't need to install Node, Puppeteer or Google Chrome on your server. The heavy lifting of booting a headless Google Chrome instance is happening on AWS Lambda.
Requirements
This package requires that spatie/browsershot and hammerstone/sidecar have been installed in your Laravel application.
Follow their installation and configuration instructions. (You can skip the installation of puppeteer and Google Chrome for Browsershot though.)
Installation
You can install the package via composer:
Register the BrowsershotFunction::class in your sidecar.php config file.
Deploy the Lambda function by running:
See Sidecar documentation for details.
Usage
You can use BrowsershotLambda like the default Browsershot-class coming from the Spatie package.
All you need to do is replace Browsershot with BrowsershotLambda.
Saving directly to S3
You can store your file directly on AWS S3.
- You must add an
s3_bucketands3_regionkeys added to config/sidecar.php - You must give S3 write permissions to your sidecar-execution-role
After the above settings, you can use saveToS3 method on BrowsershotLambda.
Testing
The testsuite makes connections to AWS and runs the deployed Lambda function. In order to run the testsuite, you will need an active AWS account.
We can use the native sidecar:configure artisan command to create the necessary AWS credentials for Sidecar. First copy the testbench.example.yaml file to testbench.yaml.
Then run ./vendor/bin/testbench sidecar:configure to start the Sidecar setup process. (You only have to do the setup once)
After finishing the Sidecar setup process, you will have received a couple of SIDECAR_* environment variables. Add these credentials to .env.
Now we can deploy our local BrowsershotFunction to AWS Lambda. Run the following command in your terminal, before executing the testsuite.
After the successful deployment, you can run the testsuite.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Stefan Zweifel
- Aaron Francis
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of sidecar-browsershot with dependencies
hammerstone/sidecar Version ^0.3.7
illuminate/contracts Version ^8.0|^9.0
spatie/browsershot Version ^3.52
spatie/laravel-package-tools Version ^1.9.2