Whether you are looking to get started, or already have an established codebase, Browserless aims to make the transition as easy as possible. At a high-level, you'll need to do the following:
If you haven't chosen a library yet we highly recommend puppeteer as it's fairly active and has many maintainers. It's also built by the developers of Chrome, so it's one of the highest quality libraries around.
pnpm
yarn
npm
3
Setup your app use Browserless
As an example let's write a screenshot service that takes a picture of the website and downloads it. We'll setup a route on the /image path and take a picture of a static webpage (though you can make this configurable if you wish):Once we have Browserless account setup, we can simply "connect" to it in our application instead of launching local Chrome.Screenshot service with Browserless
WARNING
The kernelMilestone parameter has a fixed value of 132 currently.
That's it! Now you don't have to worry about bundling Chrome or it's dependencies in production and can continue to develop your application.Below is a sample cURL call that will use your new service to ensure it's all working:
4
View the Browserless dashboard
You can view the statistics of recent requests and the remaining session time in the Browserless menu of the Nstbrowser client.