Supabase | The Open Source Firebase Alternative
Build production-grade applications with a Postgres database, Authentication, instant APIs, Realtime, Functions, Storage and Vector embeddings. Start for free.
supabase.com
1. 회원가입 (git으로 가입 가능)
2. 새로운 프로젝트 생성
3. 데이터 생성
4. 내 프로젝트와 연결
- supabase 설치
- Project URL과 API keys 가져와서 프로젝트와 연결
Problem
이 과정에서 anon public 코드를 바로 복사해서 붙여 넣으니 데이터가 불러와지지 않았다.
그 아래에 있는 secret 키를 넣으니 불러와지기는 했지만 public 키로 불러오는 것이 목적이므로-
Solve
이유는 내가 만들어준 데이터 테이블에 policy를 지정해주지 않았기 때문이었다.
supabase dashboard / Authentication / Configuration > Policies
각 데이터 테이블에 해당하는 policy를 설정해줘야 한다. 그렇게 세팅을 바꿔주고 나면 Applied to : public 으로 변경된 것을 확인할 수 있었고, 데이터도 잘 불러와졌다.
참고 웹사이트 https://galaxies.dev/react-supabase
How to use Supabase with ReactJS
Learn to integrate Supabase with React to create powerful apps with SQL database.
galaxies.dev
'What I Learnd > TIL' 카테고리의 다른 글
TIL - Next.js 설치 및 기능 알아보기 1 (0) | 2023.08.17 |
---|---|
TIL - supabase TypeScript 외래키(foreign key)로 연결된 테이블 값 불러오기 (0) | 2023.08.11 |
TIL - yarn berry 설치 Zero Install 셋업하기 (0) | 2023.08.08 |
TIL - TypeScript로 방명록 남기기 페이지 만들기 (0) | 2023.08.03 |
TIL - localStorage 메소드 정리 (0) | 2023.08.03 |