functions

द्वारा browserbase

Browserbase का उपयोग करके सर्वरलेस ब्राउज़र ऑटोमेशन को क्लाउड फंक्शन के रूप में तैनात करें। इसका उपयोग तब करें जब उपयोगकर्ता ब्राउज़र ऑटोमेशन को शेड्यूल या क्रॉन पर चलाने के लिए तैनात करना चाहता हो,…

npx skills add https://github.com/browserbase/skills --skill functions

Browserbase Functions

Deploy serverless browser automation using the official browse CLI.

Prerequisites

Get an API key from: https://browserbase.com/settings

export BROWSERBASE_API_KEY="your_api_key"

Creating a Function Project

1. Initialize

browse functions init my-function
cd my-function

This creates:

my-function/
├── package.json
├── index.ts        # Your function code
└── .env            # Add credentials here

2. Add Credentials to .env

echo "BROWSERBASE_API_KEY=$BROWSERBASE_API_KEY" >> .env

3. Install Dependencies

pnpm install

Function Structure

import { defineFn } from "@browserbasehq/sdk-functions";
import { chromium } from "playwright-core";

defineFn("my-function", async (context) => {
  const { session, params } = context;

  // Connect to browser
  const browser = await chromium.connectOverCDP(session.connectUrl);
  const page = browser.contexts()[0]!.pages()[0]!;

  // Your automation
  await page.goto(params.url || "https://example.com");
  const title = await page.title();

  // Return JSON-serializable result
  return { success: true, title };
});

Key objects:

  • context.session.connectUrl - CDP endpoint to connect Playwright
  • context.params - Input parameters from invocation

Development Workflow

1. Start Dev Server

browse functions dev index.ts

Server runs at http://127.0.0.1:14113

2. Test Locally

curl -X POST http://127.0.0.1:14113/v1/functions/my-function/invoke \
  -H "Content-Type: application/json" \
  -d '{"params": {"url": "https://news.ycombinator.com"}}'

3. Iterate

The dev server auto-reloads on file changes. Use console.log() for debugging - output appears in the terminal.

Deploying

browse functions publish index.ts

Output:

Function published successfully
Build ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Function ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Save the Function ID - you need it to invoke.

Quick Reference

CommandDescription
browse functions init <name>Create new project
browse functions dev <file>Start local dev server
browse functions publish <file>Deploy to Browserbase

For invocation examples, common patterns, and troubleshooting, see REFERENCE.md.

browserbase की और Skills

optimize-agent-prompt
browserbase
Browserbase Agent API डेमो को Autobrowse-शैली आउटर लूप के माध्यम से बनाता और बेहतर बनाता है: एक निश्चित कार्य चलाएं, Agent संदेश और सत्र लॉग एकत्र करें, परिणाम स्कोर करें, एक सिस्टम-प्रॉम्प्ट ह्यूरिस्टिक को संशोधित करें, और अभिसरण की पुष्टि करें। Browserbase Agents डेमो या POC बनाते समय, Agent सिस्टम प्रॉम्प्ट को अनुकूलित करते समय, अस्थिर Agent रन का निदान करते समय, या Browserbase Agents API पर ऑटो-रिसर्च/ऑटोब्राउज़ लागू करते समय उपयोग करें।
add-webmcp
browserbase
किसी मौजूदा वेब एप्लिकेशन का विश्लेषण करें, रूट्स, फॉर्म्स, सर्वर एक्शन्स, हैंडलर्स और स्कीमा में सुरक्षित उपयोगकर्ता-दृश्य क्षमताओं की पहचान करें, फिर प्रथम-पक्ष WebMCP टूल्स लागू करें और Stagehand के साथ डिस्कवरी और इनवोकेशन को मान्य करें। इसका उपयोग तब करें जब उपयोगकर्ता कोडबेस को एजेंट-रेडी बनाने, वेबसाइट सुविधाओं को WebMCP टूल्स के रूप में उजागर करने, या URL से स्टैंडअलोन इंजेक्शन स्क्रिप्ट उत्पन्न करने के बजाय सीधे ऐप में WebMCP जोड़ने के लिए कहे।
browse
browserbase
ब्राउज़ CLI का उपयोग Browserbase ब्राउज़र स्वचालन, Browserbase क्लाउड APIs, Browserbase Functions, टेम्पलेट्स, वेब फ़ेच/खोज, डायग्नोस्टिक्स, और Browse.sh… के लिए करें।
browse
browserbase
ब्राउज़ CLI का उपयोग Browserbase ब्राउज़र स्वचालन, Browserbase क्लाउड APIs, Browserbase Functions, टेम्पलेट्स, वेब फ़ेच/खोज, डायग्नोस्टिक्स, और Browse.sh… के लिए करें।
browser-automation
browserbase
MCP टूल्स का उपयोग करके वेब ब्राउज़र इंटरैक्शन को स्वचालित करें। तब उपयोग करें जब उपयोगकर्ता वेबसाइट ब्राउज़ करने, वेब पेज नेविगेट करने, वेबसाइटों से डेटा निकालने, स्क्रीनशॉट लेने,… के लिए कहे।
functions
browserbase
सर्वरलेस ब्राउज़र स्वचालन की तैनाती का मार्गदर्शन करें, आधिकारिक Browserbase Functions CLI का उपयोग करके। उपयोग करें जब उपयोगकर्ता स्वचालन को तैनात करना चाहता है ताकि यह एक… पर चल सके।
agent-experience
browserbase
किसी उत्पाद, SDK, दस्तावेज़ साइट, या SKILL.md के डेवलपर अनुभव का ऑडिट करें, इसमें केवल एक छोटे कार्य संकेत और वास्तविक… के साथ कई Claude उप-एजेंट लगाकर।
autobrowse
browserbase
स्व-सुधारात्मक ब्राउज़र स्वचालन ऑटो-रिसर्च लूप के माध्यम से। ब्राउज़िंग कार्य को पुनरावृत्त रूप से चलाता है, ट्रेस पढ़ता है, और नेविगेशन कौशल में सुधार करता है…