INTEGRATIONS / RUNTIME RECIPE

Vera, meet Bun.

Use Bun for a small data script or server workflow. This recipe reads a server environment variable, sends one request and checks the response.

← All integrations

Your first connection.

  1. 01

    Use Bun and set VERA_API_KEY in your shell or a local .env file that is excluded from version control.

  2. 02

    Save the Bun example below as vera.ts and run bun run vera.ts.

  3. 03

    Inspect the response and credits header. Keep parallel requests within the limits shown in your Vera account.

Tool reference: Bun documentation ↗

Build the request.

Set the environment variables in your terminal for these code examples. In automation tools, enter the URL and credentials in the tool’s own fields.

vera.tsTypeScript · Bun
const apiKey = Bun.env.VERA_API_KEY;
if (!apiKey) throw new Error("Set VERA_API_KEY");
const response = await fetch("https://vera.waggle.ae/api/vera/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://example.com" }),
  signal: AbortSignal.timeout(45000),
});
const result: unknown = await response.json();
if (!response.ok) {
  throw new Error(`Vera HTTP ${response.status}: ${JSON.stringify(result)}`);
}
console.log("Credits used:", response.headers.get("X-Vera-Credits-Used"));
console.log(result);
export {};

Reading or copying this example does not send a request or use credits.

YOUR PRIVACY

Choose what works for you. You can reopen these settings from the footer at any time.

Essential

Always active

Sign-in, security and preferences you ask us to remember. These keep the service working.

Analytics

Optional Vera visitor reporting counts visits and active browsers; Google Analytics may also measure selected clicks. We don’t send form contents, requested URLs, search queries, passwords, API keys or account emails. Turn it off here at any time.

Advertising

Not in use

No advertising cookies or remarketing tags.

Your choice is stored on this browser for 180 days. Read the cookie policy ↗