Download the PHP package wnx/sidecar-browsershot without Composer

On this page you can find all versions of the php package wnx/sidecar-browsershot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sidecar-browsershot

Run Browsershot on AWS Lambda with Sidecar for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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:

You can publish the config file with:

Register the BrowsershotFunction::class in your sidecar.php config file.

Deploy the Lambda function by running:

See Sidecar documentation for details.

[!Note] You should redeploy the Lambda function, whenever you upgrade spatie/browsershot.

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.

Warming

sidecar-browsershot supports warming for faster execution.

To enable this feature set the SIDECAR_BROWSERSHOT_WARMING_INSTANCES variable in your .env to the desired number of instances Sidecar should warm for you.

Alternatively you can publish the sidecar-browsershot.php config file and change the warming setting yourself.

Reading source from S3

You can store an HTML file on AWS S3 and pass the path to Lambda for it to create the PDF or image from. This is necessary for large source files in order to avoid restrictions on the size of Lambda requests.

Saving directly to S3

You can store your file directly on AWS S3 if you want to keep it there, or to avoid the size limit on Lambda responses.

You just need to pass a path and optional disk name (default: 's3') to the saveToS3 method.

Image Manipulation

Like the original Browsershot package, you can manipulate the image size and format.

To perform image manipulations on the screenshot, you need to install the optional dependency spatie/image. v3 or higher is required.

Note
If you're using fit() in combination with saveToS3, the image will be downloaded from S3 to your local disc, manipulated and then uploaded back to S3.

Register Custom Fonts

By default, sidecar-browsershot includes the "Noto Color Emoji"-font, to ensure that emojis are rendered correctly. If you want to use custom fonts, you can put them all into a resources/sidecar-browsershot/fonts-folder. (You can customize the location of that folder in the sidecar-browsershot.fonts config)

sidecar-browsershot will include all files in that folder when deploying the Lambda function and will register them automatically in Chromium for you.

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

License

The MIT License (MIT). Please see License File for more information.


All versions of sidecar-browsershot with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
hammerstone/sidecar Version ^0.4 || ^0.5 || ^0.6
illuminate/contracts Version ^10.0 || ^11.0
spatie/browsershot Version ^4.0 || ^5.0
spatie/laravel-package-tools Version ^1.9.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wnx/sidecar-browsershot contains the following files

Loading the files please wait ....