mirror of
https://github.com/supabase/supabase.git
synced 2026-06-23 03:08:54 +08:00
# Second try of making a new better process for SDK automation Instead of building a new pipeline. We will take the lessons learned form round 1, plus the good design and improvement on DX quality for drop-in file as a single step required from SDK team and produce almost identical set of files as used right now to render using the current pipeline. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * New reference-content pipeline producing per-library reference artifacts and integrating into prebuilds, search ingestion, and rendering (type-aware examples). * **Documentation** * Added comprehensive JavaScript SDK v2 reference content and partials (Auth MFA, passkeys, admin, TypeScript support, filters, modifiers, Installing, Initializing, Buckets, etc.). * **Tests & CI** * Added regression snapshot test and updated workflows to refresh reference snapshots and ensure spec downloads. * **Chores** * Updated ignore rules, build scripts, Makefile targets, and package lifecycle hooks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Katerina Skroumpelou <mandarini@users.noreply.github.com> Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
120 lines
3.0 KiB
Plaintext
120 lines
3.0 KiB
Plaintext
---
|
|
id: installing
|
|
title: 'Installing'
|
|
slug: installing
|
|
---
|
|
|
|
### Install as package
|
|
|
|
<RefSubLayout.EducationRow>
|
|
<RefSubLayout.Details>
|
|
|
|
You can install @supabase/supabase-js via the terminal.
|
|
|
|
</RefSubLayout.Details>
|
|
|
|
<RefSubLayout.Examples>
|
|
|
|
<Tabs
|
|
size="small"
|
|
type="underlined"
|
|
defaultActiveId="npm"
|
|
queryGroup="platform"
|
|
>
|
|
<TabPanel id="npm" label="npm">
|
|
|
|
```sh Terminal
|
|
npm install @supabase/supabase-js
|
|
```
|
|
|
|
</TabPanel>
|
|
<TabPanel id="yarn" label="Yarn">
|
|
|
|
```sh Terminal
|
|
yarn add @supabase/supabase-js
|
|
```
|
|
|
|
</TabPanel>
|
|
<TabPanel id="pnpm" label="pnpm">
|
|
|
|
```sh Terminal
|
|
pnpm add @supabase/supabase-js
|
|
```
|
|
|
|
</TabPanel>
|
|
</Tabs>
|
|
|
|
</RefSubLayout.Examples>
|
|
</RefSubLayout.EducationRow>
|
|
|
|
### Install via CDN
|
|
|
|
<RefSubLayout.EducationRow>
|
|
<RefSubLayout.Details>
|
|
|
|
You can install @supabase/supabase-js via CDN links.
|
|
|
|
</RefSubLayout.Details>
|
|
|
|
<RefSubLayout.Examples>
|
|
|
|
```js
|
|
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
|
|
//or
|
|
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
|
|
```
|
|
|
|
</RefSubLayout.Examples>
|
|
</RefSubLayout.EducationRow>
|
|
|
|
### Use at runtime in Deno
|
|
|
|
<RefSubLayout.EducationRow>
|
|
<RefSubLayout.Details>
|
|
|
|
You can use supabase-js in the Deno runtime via [JSR](https://jsr.io/@supabase/supabase-js):
|
|
|
|
</RefSubLayout.Details>
|
|
|
|
<RefSubLayout.Examples>
|
|
|
|
```ts
|
|
import { createClient } from 'npm:@supabase/supabase-js@2'
|
|
```
|
|
|
|
</RefSubLayout.Examples>
|
|
</RefSubLayout.EducationRow>
|
|
|
|
### Enable Data API access
|
|
|
|
<RefSubLayout.EducationRow>
|
|
<RefSubLayout.Details>
|
|
|
|
supabase-js uses the Data API to query and mutate your Postgres data. You first need to grant Data API roles permissions to access your tables and functions.
|
|
|
|
In [Data API integrations settings](/dashboard/project/_/integrations/data_api/settings), expose the specific tables and functions you want to access. To automatically grant access for new tables and functions in `public`, enable **Default privileges for new entities**.
|
|
|
|
Alternatively, use SQL to grant the required permissions:
|
|
|
|
</RefSubLayout.Details>
|
|
|
|
<RefSubLayout.Examples>
|
|
|
|
```sql
|
|
-- Before granting access to client roles, make sure RLS is enabled
|
|
-- and create the policies required for each role's allowed operations.
|
|
alter table public.your_table enable row level security;
|
|
-- create policy ... on public.your_table ...;
|
|
|
|
-- Grant least-privilege access to tables after RLS and policies are in place
|
|
grant select on public.your_table to anon;
|
|
grant select, insert, update, delete on public.your_table to authenticated;
|
|
grant all on public.your_table to service_role;
|
|
|
|
-- Grant execute on functions after verifying any table access they rely on
|
|
grant execute on function public.your_function to authenticated, service_role;
|
|
```
|
|
|
|
</RefSubLayout.Examples>
|
|
</RefSubLayout.EducationRow>
|