Configuring the viewport
Use theviewport field when creating a session to specify the desired width and height. Below are examples in both Node.js and Python SDKs.
- Node.js
- Python
Verified sessions use a fixed viewport managed by Browserbase. Custom viewport dimensions are not supported with Verified. See the Verified customization guide for more details.
Setting the viewport with Puppeteer
If you’re using Puppeteer, it applies an800 x 600 viewport by default. To customize these dimensions, you’ll also need to set defaultViewport to null as shown below.