Firestore and Svelte Kit

This page summarizes the projects mentioned and recommended in the original post on /r/sveltejs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • nodejs-firestore

    Node.js client for Google Cloud Firestore: a NoSQL document database built for automatic scaling, high performance, and ease of application development.

  • One thing to note is that the 'firebase' package only works from the browser. In svelte-kit the components may be rendered on the server depending on how a page is loaded. You'll have to make sure that any calls to anything imported from 'firebase/firestore' are only run in the browser. You can do this with the the brwoser global imported from $app/env as described here https://kit.svelte.dev/docs#modules-$app-env. Obviously this negates the benefits of server side rendering. If you want the bits which depend of firestore to be server side rendered you'll need to write code which can access firestore that is compatible with NodeJS. You can use the google cloud package https://github.com/googleapis/nodejs-firestore. For some reason the 'firebase-admin' package which is supposed to be the package to use for NodeJS doesn't play nicely with vite and svelte-kit. But in practice 'firebase-admin' just returns an instance of Firestore from the '@google-cloud/firestore' anyway so it shouldn't make too much difference.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts