An easy to use Firebase library for SvelteKit.
Inspired by SvelteFire.
- Authentication
- Firestore
- Storage coming
- Realtime Database coming
There is a demo repo here
npm i svelte-flame
// ./firebaseInit.js
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
const firebaseConfig = {
// Your firebase config
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);
<!-- ./src/routes/+layout.svelte -->
<script lang="ts">
import { db, auth } from './firebaseInit.js';
import { SvelteFlame } from 'svelte-flame';
</script>
<SvelteFlame {auth} fireStore="{db}">
<slot />
<!-- Your app -->
</SvelteFlame>
<script lang="ts">
import { Document } from 'svelte-flame';
</script>
<Document ref="messages/message" " let:data="{message}">
{#if message !== null}
<p>Document data: {message?.from}: {message?.text}</p>
{/if}
</Document>