# Connect your existing client to Scribase

> Point an existing app at Scribase by changing two environment variables: the client, environment config, and verifying the connection.

Source: https://scribase.com/guides/connect-your-client

Reading time: ~4 min.

Scribase keeps its data plane wire-compatible with the client SDK your app already uses, so an existing app moves over by changing the project URL and keys — not by rewriting code. This guide walks through pointing the client at Scribase and confirming auth, data, and realtime still work.

## Set the project URL and anon key

Copy the project URL and anon (publishable) key from the Scribase console and put them in your environment. These replace your current values; the variable names your app already uses can stay the same.

```bash
# .env — swap the two values; keep the names your app already uses
SCRIBASE_URL=<environment URL from the console>
SCRIBASE_ANON_KEY=sb_publishable_…
```

## Create the client as usual

The client constructor does not change. It reads the URL and key from the environment, so the same code that talked to your old backend now talks to Scribase.

```ts
import { createClient } from '@supabase/supabase-js'

export const client = createClient(
  process.env.SCRIBASE_URL!,
  process.env.SCRIBASE_ANON_KEY!,
)
```

## Verify auth, data, and realtime

Run a signed-in query and open a realtime subscription. Both use the same /auth, /rest, and /realtime paths that are contract-tested for compatibility, so a green result confirms the swap worked.

```ts
const { data, error } = await client
  .from('todos')
  .select('id, title')

client.channel('todos')
  .on('postgres_changes',
     { event: '*', schema: 'public', table: 'todos' },
     (payload) => console.log(payload))
  .subscribe()
```

## FAQ

**Do I need to change my client code?**

No. Only the URL and key change. The /auth, /rest, /realtime, /storage, and /functions/v1 paths are contract-tested for compatibility, so the client code stays the same.

**Do my existing CLI scripts work too?**

Yes. Point them at the Scribase URL and keys the same way — they use the same data-plane paths as the client SDK.

## Related

- [Features](https://scribase.com/features)
- [Bring an existing project](https://scribase.com/guides/bring-an-existing-project)