INTEGRATIONS / SERVER INTEGRATION

Vera, meet Next.js.

Keep Vera credentials on the server, fetch only when your application requests work, and return the fields your UI needs.

← All integrations

Your first connection.

  1. 01

    Add VERA_API_KEY to .env.local or your hosting secret store. Do not prefix it with NEXT_PUBLIC_. Install the server-only package in your app.

  2. 02

    Save the helper below as lib/vera.ts. Import it only from server code, such as an authenticated Route Handler or a background job.

  3. 03

    Call extractPage after your own session and quota checks. Do not expose an unauthenticated proxy or automatically spend credits during page rendering or prefetching.

Tool reference: Next.js 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.

lib/vera.tsTypeScript · server only
import "server-only";

// Call from an authenticated server workflow, after your own quota checks.
// This helper does not create a public route or an automatic page-render fetch.
export async function extractPage(url: string): Promise<unknown> {
  const apiKey = process.env.VERA_API_KEY;
  if (!apiKey) throw new Error("Set VERA_API_KEY on the server");
  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 }),
    cache: "no-store",
    signal: AbortSignal.timeout(45000),
  });
  const result: unknown = await response.json();
  if (!response.ok) {
    throw new Error(`Vera HTTP ${response.status}: ${JSON.stringify(result)}`);
  }
  return result;
}

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 ↗