Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT Secret Docs for Supabase #3179

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/docs/docs/tools-and-technologies/supabase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 9
---

# Supabase

Telescope uses Supabase, an open-source Firebase alternative, to store user and feeds tables, and handle authorization.

## Environment Variables

### JWT_SECRET

- We use a `JWT_SECRET` (shared between SSO and Supabase) to sign the user info and send back the token to the client
- The client calls `supabase.auth.setAuth(token)`. Because the `JWT_Secret` is shared between SSO and Supabase, the user is authenticated.
- With Supabase, we can add a policy that looks at `request.jwt.roles` or `request.jwt.id` to determine if they are allowed to do something with the database.

### ANON_KEY

- This key is used to bypass the Supabase API gateway and can be used in your client-side code.
- We use it to initialize the Supabase client in the front-end
2 changes: 1 addition & 1 deletion src/docs/docs/tools-and-technologies/turborepo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 9
sidebar_position: 10
---

# Turborepo and Telescope
Expand Down