Overview
The Browserbase Playground provides a visual interface for creating and deploying Functions without needing to set up a local development environment. Write your Stagehand automation script directly in the browser, test it with the Run button, and deploy as a function with a single click.
Why Use the Playground?
- No Local Setup - Start writing functions immediately without installing any tools
- Instant Feedback - Test your automation and see results in real-time
- Built-in Editor - Full-featured code editor with Stagehand support
- Function Parameters - Define input parameters with optional default values
- One-Click Deploy - Publish your function directly to Browserbase infrastructure
- Live Session View - Watch your automation run in a live browser view
Creating and Deploying a Function
Open the Playground
Navigate to the Browserbase Dashboard and click on Playground in the navigation bar.
Write Your Script
The Playground editor comes pre-loaded with a Stagehand template. Write your automation logic using the Stagehand framework:
The Playground automatically provides Stagehand configuration and initialization. You can also use the Convert to Stagehand button to convert plain Playwright scripts.
Define Function Parameters
Use the Function Parameters panel on the right side to define inputs for your function. Click + Add to create parameters:

- Parameter name - The key used to access the value (e.g.,
searchQuery) - Default value - Optional fallback value if not provided at invocation
params object:You can define up to 8 function parameters. Some parameters like
modelApiKey are provided automatically in the Playground environment.Test Your Script
Click the Run button to test your script. The Playground will:
- Create a new browser session
- Execute your automation code
- Display console output and results
- Show a live view of the browser session
Deploy as Function
Once you’re satisfied with your script:
-
Set the Function Name in the panel on the right (e.g.,
search-hacker-news) -
Click Deploy in the toolbar, then select Deploy as Function

- Confirmation that your function is live
- A ready-to-use cURL command for invoking your function
- A View Function button to see your function in the Functions dashboard
Managing Deployed Functions
Click View Function in the deployment modal or navigate to the Functions tab to see your deployed functions. From here you can:- View function details and invocation history
- See previous versions of your function
- Copy the invoke URL and cURL commands
- Delete functions you no longer need