@mierune/sveltekit-firebase-auth-ssr
v0.0.9
Published
![NPM Version](https://img.shields.io/npm/v/%40mierune%2Fsveltekit-firebase-auth-ssr)
Downloads
497
Readme
@mierune/sveltekit-firebase-auth-ssr
SvelteKit を SSR で使う場合に、Firebase Authentication による認証を組みこむためのパッケージです。
Node.js 環境だけでなく、Cloudflare Pages/Workers 単独でも動作するように実装されています。
Usage
用意するもの:
- Firebase プロジェクトの Project ID
- Firebase プロジェクトの API Key
- Firebase の(Google Cloudの)サービスアカウントキー
src/hooks.client.ts
にコードを加える。例)TODOsrc/hooks.server.ts
にコードを加える。例)TODOsrc/app.d.ts
にコードを加える。例)TODOsrc/routes/+layout.server.ts
にコードを加える。例)TODO適切な場所でサインインとサインアウトを実装する。例)TODO
必要な場所でユーザ情報を利用する。
必要な環境変数を、実行環境に忘れずに設定する。