- Notifications
You must be signed in to change notification settings - Fork5
Firebase ❤️ Svelte: A SvelteKit + Typescript + Firebase library inspired by Fireship.io
License
jacob-8/sveltefirets
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
April 2024 Status Update: I still use this library in production and it's very useful, but I've moved on to using Supabase by and large. Because this library is stable, because the originalSvelteFire gets a few updates here and there, and because I'm not expanding my use of Firebase, most active development has ceased. But it works great in SvelteKit 2 and Svelte 4. My recommendation is toread the docs,read the code,read Jeff's code, then copy what you need and hone it to your use case. You'll be a better developer for it.
As I've progressed in my understanding of how to use SvelteKit well, I've learned that it will make component design and mocking (I useKitbook) much easier if you establish backend connections in the layout/page ts files and pass data and mutation operations to components via the page data prop. So that is why I say write your own. I presently no longer use the<Doc>
and<Collection>
components but solely lean on thegetDoc
,getCollection
,docStore
andcollectionStore
methods for this reason.
Easily useFirebase in Svelte. Built forSvelteKit 2.0+ but it could be used with any Svelte framework.
- SvelteKit (tested on 2.5.1)
- Typescript
- Firestore convenience helpers
- Auth store
- SSR ready (for unauthenticated data fetching)
- Firebase (tested on 10.9.0)
- includes an optional FirebaseAuthUi component that brings inFirebaseUI web + Firebase 10 compat via CDN only when component shown - FirebaseUI web allows for easy authentication in dozens of languages and many providers without you needing to manage the authentication forms
If there are any configuration settings or features you'd like to see added pleasecreate an issue to start a discussion about features you'd like. After discussion, hopefully you can add a pull request to implement such.
Note that theset
helper method which automatically is either anupdate
or aset
depending on whether a document exists should really be renamed toupsert
in order to makeset
more closely resemble Firestore'ssetDoc
.
pnpm install
pnpm dev
Inspiration:Fireship.io
Jeff Delaney gets credit for much of SvelteFireTS. I started withSvelteFire then added Typescript, borrowed some convenient helpers from Jeff'sFirestore Advanced Usage Angularfire, and made it work with SvelteKit's SSR + Client situation. If you like what you see here, you should sign up atFireship.io and subscribe to theFireship Youtube Channel for great tutorials.
About
Firebase ❤️ Svelte: A SvelteKit + Typescript + Firebase library inspired by Fireship.io
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.