Files
supabase/web/docs/library/getting-started.mdx
T

57 lines
1.3 KiB
Plaintext
Executable File

---
id: getting-started
title: Getting Started
description: 'How to install Supabase and start interacting with your database'
---
## Installing
```bash
npm install --save @supabase/supabase-js
# OR
yarn install @supabase/supabase-js
```
## Initializing
```js
import { createClient } from '@supabase/supabase-js'
// Create a single supabase client for interacting with your database
const supabase = createClient("https://xyzcompany.supabase.co", "1a2b-3c4d-5e6f-7g8h");
```
## Reference
### `createClient()`
```js
createClient('supabaseURL', 'supabaseKey', OPTIONS)
```
#### `supabaseURL: string`
The unique Supabase URL which is supplied when you create a new project in [your project dashboard](https://app.supabase.io).
#### `supabaseKey: string`
The unique Supabase Key which is supplied when you create a new project in [your project dashboard](https://app.supabase.io).
#### `OPTIONS: object?`
```js
/**
* @param {string} [schema='public']
* You can switch in between schemas.
* The schema however would need to be on the list of exposed schemas.
* Defaults to the 'public' schema.
* If there is the need to use more than one schema,
* another instance of .createClient() would need to be instantiated.
*/
const options = {
schema: 'public'
}
```