# Add teams to a v0 app (Next.js App Router, BuildBase sign-in)

One prompt that adds a workspace switcher, members and email invites to a v0 app, and scopes your own tables by workspace.

v0 can also connect to BuildBase itself while it builds: [Use BuildBase in v0](/console/ai-agents/v0).

Each customer gets a workspace, a switcher in the header, and a members screen where an admin invites a colleague by email. Workspaces, members and roles live in BuildBase; your own tables stay in your database, scoped by the workspace id. This page assumes the app already signs people in with @buildbase/sdk, as the [v0 guide](https://www.buildbase.app/guides/add-sign-in-teams-and-paid-plans-to-a-v0-app) sets up. If it signs people in with something else, such as Supabase or Clerk, read [keep your existing sign-in](/sign-in-setup/keep-your-sign-in) first.

> **Note:**
  A sender connected in the console, so invitation emails go out ([connect a
  sender](/email/connect-a-sender)).

## The prompt

v0's docs document no link that opens v0 with a prompt filled in, so copy this into your project's chat.

```text
This app signs people in with BuildBase (@buildbase/sdk), set up as https://www.buildbase.app/guides/add-sign-in-teams-and-paid-plans-to-a-v0-app shows. If it does not, stop and tell me.
Read https://docs.buildbase.app/workspaces/overview.md first and do not invent endpoints.
- In a client component, add WorkspaceSwitcher from @buildbase/sdk/react to the header, and a Members button that calls openWorkspaceSettings('users') from useSaaSAuth().
- Give every table of mine a workspace_id column and filter every query by currentWorkspace._id from useSaaSWorkspaces().
- In route handlers and server actions, check the workspace id from the request is in bb().workspace.list() from lib/buildbase.ts before reading or writing its rows.
Do not create workspace, membership or role tables in my database, and do not add Clerk, Auth0 or Better Auth organizations; BuildBase holds them.
```

## Where the secrets go

This job adds no new secret. `BUILDBASE_CLIENT_SECRET` stays where the guide put it: the Vercel project's environment variables (**Project menu** > **Settings** > **Environment Variables** in v0), with no `NEXT_PUBLIC_` prefix. Route handlers use the signed-in person's session cookie, `bb-session-id`.

## The v0 trap

v0 loads a provider's skills by itself when its integration is installed, and Clerk and Auth0 are one click from the chat. If either is installed in the project, v0 may build teams on it instead. Check **Project menu** > **Settings** > **Integrations** before you paste, and remove a sign-in integration you do not use.

Then test it: sign in as a member of one workspace and change an id in the address bar. If you see another workspace's rows, a query is missing its `workspace_id` filter. The SDK scopes what it holds; your tables are yours to scope.

## Full guides

- [Add sign-in, teams and paid plans to a v0 app](https://www.buildbase.app/guides/add-sign-in-teams-and-paid-plans-to-a-v0-app)
- [Workspaces](/workspaces/overview) and [invitations](/workspaces/invitations)
- [Add BuildBase to v0's instructions](/ai-builders/v0-import)
