supabseメモ
react + viteで行くつもりなのでまずはインストール
npm create vite@latest supabaseapp --template react-ts
cd supabaseapp
npm install
テンプレートオプションをつけたけど普通にvueとかも選べた。
よくわからん。
supabseのauth, databaseを利用する。
まずはauthから。
npm install @supabase/supabase-js @supabase/auth-ui-react @supabase/auth-ui-shared
supabase-jsは名前的にtypescript対応してるか不安だったが、普通に公式に書いてあった。
supabase-js has TypeScript support for type inference, autocompletion, type-safe queries, and more.
With TypeScript, supabase-js detects things like not null constraints and generated columns. Nullable columns are typed as T | null when you select the column. Generated columns will show a type error when you insert to it.
supabase-js also detects relationships between tables. A referenced table with one-to-many relationship is typed as T[]. Likewise, a referenced table with many-to-one relationship is typed as T | null.
supabase/auth-ui-react ,supabase/auth-ui-shared についても調べようかと思ったが、今年の1月に出された記事だと使えてるぽそうなのでインストールすることにした。