v0 logoVibe-coding platform·Vercel

v0 + Powabase

v0 writes the Next.js UI. Powabase serves what it shows.

v0 generates Next.js components and ships them fast. Set your Powabase URL and Service Role key as environment variables and its server actions can read your tables, run agents, and search a knowledge base.

Rather have it built? Powabase engineers build MVPs free for annual Scale and Enterprise plans.

Quick start

Three steps and v0 is building on Powabase.

  1. 1

    Create a Powabase project

    Create a project at app.powabase.ai and open the Connect dialog (top-left in Studio). Copy the Project URL and the Service Role (Secret) Key. The Service Role key reaches everything: the agent and AI endpoints, plus full database access. Keep it on the server and never put it in the browser.

    The Powabase Connect dialog showing the Project URL, Anon key, Service Role key, JWT secret, and Database URL
    The Connect dialog in Powabase Studio.
  2. 2

    Set environment variables

    Set the Project URL and Service Role key in your v0 or Vercel project so server actions can reach Powabase. Keep the key out of client components.

    Environment
    BASE_URL=<Project URL>
    API_KEY=<Service Role (Secret) Key>
  3. 3

    Describe the app

    Ask v0 for the interface. It writes the components and server actions that hit Powabase. The examples below are a good starting point.

Example apps

Real apps, each from one prompt. Copy any of them and give it to v0.

RAG support chatbot

Ingest our product docs, help center, and resolved tickets into a knowledge base, embedding on upload. Expose a support agent that answers with inline citations, streams over SSE, and hands off to a human when confidence is low. Add email and Google sign-in, isolate every conversation per organization with row-level security, and ship it as an embeddable chat widget.

Internal knowledge assistant

Index our wikis, runbooks, and exported threads into a knowledge base, chunking and embedding on upload. Expose an agent that answers with citations and respects per-department access, keep it fresh with scheduled re-indexing of changed sources, and add SSO sign-in plus an analytics view of unanswered questions.

AI help desk

Model tickets, organizations, and agents with row-level security, and auto-triage incoming tickets with an agent that predicts category and priority and drafts a reply from the knowledge base. Escalate low-confidence cases, run SLA timers as scheduled jobs, add email auth, and provide a live queue dashboard.

Sales CRM

Model companies, contacts, deals, and activities in Postgres with row-level security per team and roles for reps and managers. Build a pipeline board with stage tracking, an activity timeline, and semantic search across notes, plus a dashboard of weighted pipeline and win rate. Wire OAuth sign-in and an audit log of every change.

News monitoring app

Pull RSS feeds and news APIs on a schedule, deduplicate and embed each article, and run an agent that clusters related stories, summarizes them, and tags entities and sentiment. Let users define watchlists and alert rules, isolate data per workspace, and deliver a realtime feed plus a daily email digest via a cron job.

Invoice & receipt automation

Accept PDF and image uploads to storage, then extract vendor, line items, totals, and dates with an extraction agent and write validated records to Postgres, routing low-confidence fields to human review. Add approval workflows, per-team access control, exports to accounting formats, and a searchable archive.

v0's one-click Supabase database is a Vercel Marketplace integration. Adding it provisions an account on supabase.com and adds that project's SUPABASE_ and POSTGRES_ variables to your Vercel project. Powabase isn't in the Marketplace, so skip that integration and add BASE_URL and API_KEY yourself under Settings → Environment Variables.

v0 docs

Where v0 keeps your keys

v0 keeps keys as Vercel environment variables, under Project menu → Settings → Environment Variables, encrypted and scoped to Production, Preview, and Development. The v0 preview panel only sees Development values. Add BASE_URL and the Service Role key without a NEXT_PUBLIC_ prefix so Next.js keeps them on the server for server actions and route handlers. Only the Anon key may carry NEXT_PUBLIC_, because anything with that prefix is inlined into the browser bundle at build time.

v0 docs

Connect over MCP

Add it from Prompt form → + → MCPs (GUI form).

GUI form
1. In the v0 prompt form, open the + menu and select MCPs.
2. Configure a custom MCP server instead of picking a preset.
3. URL: https://mcp.powabase.ai/mcp
4. Authentication: OAuth, then sign in to Powabase.

v0 uses MCP tools while it generates, for example to look at your tables before it writes a server action. The app it generates can't call MCP tools, so runtime calls still go through environment variables and the REST API. Whether a tool call runs on its own or asks first depends on the chat's Ask, Auto, or Full permission mode.

Append ?read_only=true to the MCP URL and the server exposes only the tools that don't write. We use it for sessions that should inspect a project and never mutate it.

v0 MCP docs

v0 example

app/actions.ts (server action)
"use server";

export async function askAgent(message: string, sessionId?: string) {
  const key = process.env.API_KEY!; // Service Role (Secret) Key, no NEXT_PUBLIC_
  const res = await fetch(
    `${process.env.BASE_URL}/api/agents/${process.env.AGENT_ID}/run`,
    {
      method: "POST",
      headers: { apikey: key, Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
      body: JSON.stringify({ message, session_id: sessionId }),
      cache: "no-store",
    },
  );
  if (!res.ok) throw new Error(`Agent run failed: ${res.status}`);
  return res.json(); // reply plus session_id for the next turn
}

AGENT_ID is a third environment variable with your agent's ID. A client component can import and call askAgent directly; the fetch and the key stay on the server. Before this goes live, check the caller is a signed-in user so strangers can't spend your key.

Connecting to Powabase from any tool

Mechanics that don’t change from tool to tool.

Anon (Publishable) Key
Client-side
Respects Row Level Security, so it's safe to ship to a browser.
Service Role (Secret) Key
Server-side only
Bypasses RLS. Never put it in anything that ships to a browser.
Keys & RLS docs ↗
  • Every call to /api/* or /rest/v1/* needs two headers, apikey and Authorization: Bearer, both set to the same key. Sending only one is the most common cause of a 401.

    Docs
  • The Database URL from the Connect modal is PgBouncer in transaction mode, not a direct Postgres connection. Disable prepared statements in your driver, or you'll hit prepared statement "..." does not exist. No LISTEN/NOTIFY and no session-level SET across statements. Use Realtime for change notifications; SET LOCAL inside a transaction otherwise. The username and database in the URL are both your project ref, not postgres.

    Docs
  • @supabase/supabase-js mostly works for the BaaS surface (PostgREST, Auth, Storage, Realtime) when you point it at your project URL with the Anon key. It doesn't cover the /api/* AI surface (agents, knowledge bases, orchestrations), which you call over plain REST. There's no /graphql/v1 route: point any GraphQL client at POST /rest/v1/rpc/graphql instead.

    Docs

Common errors

Works once deployed, but the v0 preview says the key is missing
Cause: The v0 preview only reads variables that are available to the Development environment.
Fix: Edit BASE_URL and API_KEY in Settings → Environment Variables and tick Development as well as Production and Preview.
The Service Role key is readable in the browser's JavaScript
Cause: It was named with a NEXT_PUBLIC_ prefix, which tells Next.js to inline it into the client bundle at build time.
Fix: Rename it without the prefix, read it only in server actions or route handlers, and redeploy. If it shipped, rotate it in Studio.
401 Unauthorized
Cause: Only one of the apikey / Authorization headers was sent.
Fix: Send both, set to the same key. Docs
prepared statement "..." does not exist
Cause: PgBouncer's transaction-mode pooler moved you to a different server connection.
Fix: Disable prepared statements in your driver's config. Docs
A query that should return rows comes back empty, or a write is silently rejected
Cause: Row Level Security on your own tables. New public tables ship with RLS off, but once you add policies they gate every request.
Fix: Check the policy's USING/WITH CHECK clause and confirm which role (anon, authenticated, service_role) you actually authenticated as. Docs

FAQ

In Project menu → Settings → Environment Variables. Add BASE_URL and API_KEY without a NEXT_PUBLIC_ prefix and tick Development so the v0 preview can use them, plus Production and Preview for deployments.

No. That integration comes from the Vercel Marketplace and provisions a Supabase account and project for you, then adds its environment variables. Powabase isn't in the Marketplace, so you set its environment variables yourself.

Yes. Open + → MCPs in the prompt form and configure a custom server with https://mcp.powabase.ai/mcp and OAuth. v0 uses the tools while it generates; your deployed app still calls Powabase over REST.

That depends on the chat's permission mode. In Ask mode, tool calls without an allow rule need your confirmation; Full mode skips approval entirely. For a session that should only look, connect the read-only MCP URL instead.