Skip to content

MIERUNE/sveltekit-firebase-auth-ssr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eae12cf · Nov 26, 2024

History

69 Commits
Nov 26, 2024
Nov 26, 2024
Jul 19, 2024
Jul 19, 2024
Sep 27, 2024
Nov 26, 2024
Sep 5, 2024
Jul 19, 2024
Jul 19, 2024
Jul 19, 2024
Nov 26, 2024
Sep 7, 2024
Sep 28, 2024
Nov 26, 2024
Jul 19, 2024
Nov 25, 2024
Nov 26, 2024
Nov 26, 2024
Nov 26, 2024
Sep 28, 2024

Repository files navigation

@mierune/sveltekit-firebase-auth-ssr

NPM Version

[WIP]

A package for integrating Firebase Authentication into SvelteKit, designed specifically for Server-Side Rendering (SSR).

It works not only in Node.js but also on Cloudflare Workers/Pages (MIERUNE/firebase-auth-cloudflare-workers-x509).

Demo: https://sveltekit-firebaseauth-ssr-stripe-demo.pages.dev/

Installation

npm install -D @mierune/sveltekit-firebase-auth-ssr

Usage

  1. Prerequisites:
    • Project ID of the Firebase project
    • API Key of the Firebase project
    • Firebase Service Account Key (from Google Cloud)
  2. Add the necessary code to the following files:
    • src/hooks.client.ts (Example: TODO)
    • src/hooks.server.ts (Example: TODO)
    • src/app.d.ts (Example: TODO)
    • src/routes/+layout.server.ts (Example: TODO)
  3. Implement sign-in and sign-out functionality in your application. (Example: TODO)
  4. Use the user information and implement database integration if needed.
  5. Ensure that the required environment variables are set in the execution environment.