# svelte-on-fire

> Provides convenience methods to simplify your Svelte/Firebase app development.

Latest version **0.4.0** (published 2023-09-16) · 0 weekly downloads

## Install

```sh
npm install svelte-on-fire
pnpm add svelte-on-fire
yarn add svelte-on-fire
bun add svelte-on-fire
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-09-16 |
| First published | 2022-10-29 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 35.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | fonner |

## Links

- npm: https://www.npmjs.com/package/svelte-on-fire
- npm.io page: https://npm.io/package/svelte-on-fire

## Dependencies (1)

- [firebase](https://npm.io/package/firebase.md) ^10.4.0

## Recent versions

- 0.4.0 (latest) — 2023-09-16
- 0.3.5 — 2023-09-16
- 0.3.4 — 2023-09-16
- 0.3.3 — 2023-09-16
- 0.3.2 — 2023-09-16
- 0.3.1 — 2023-09-15
- 0.3.0 — 2023-09-15
- 0.2.1 — 2023-09-14
- 0.2.0 — 2023-09-14
- 0.1.3 — 2023-09-14
- 0.1.1 — 2023-09-14
- 0.1.0 — 2023-09-14
- 0.0.19 — 2023-09-11
- 0.0.18 — 2023-09-11
- 0.0.17 — 2023-09-10
- … 14 more at https://npm.io/package/svelte-on-fire/versions

## README

# Svelte On Fire

Provides convenience methods to simplify your Svelte/Firebase app development.

## Basics

- Pre-created Svelte store for Firebase auth
- Utility function to create additional Svelte stores that only return data when the user is authenticated
- Convenience methods for easily querying Firestore

## Quick Start

Install from NPM

```bash
npm install svelte-on-fire
```

And do not forget to install firebase dependencies

```bash
npm install firebase
```

Create a project at https://firebase.google.com/ and grab your web config. Create a .env file in your respository like:

```
VITE_FIREBASE_API_KEY=<your API key>
VITE_FIREBASE_AUTH_DOMAIN=<your auth domain>
VITE_FIREBASE_PROJECT_ID=<your project id>
VITE_FIREBASE_STORAGE_BUCKET=<your storage bucket>
VITE_FIREBASE_MESSAGE_SENDER_ID=<your sender id>
VITE_FIREBASE_APP_ID=<your app id>
```

Opt-in to the following services from the Firebase console to run the demo.

1. Email/Password Login under authentication -> sign-in method
1. Cloud Firestore under database. Make sure it's in test mode (or provide write access to the `users/` collection using Security Rules).

## Usage

Copy the contents of `src/routes/+page.svelte` and `src/routes/firebase.ts` and into your own project. This is a basic example of how to use the library.

Note: It's highly recommended to install the Firebase emulators and run them locally. This will allow you to test your app without having to deploy it to Firebase.

<!-- ## Concepts and Examples -->

## Publishing

1. Run `npm run build` to build the library
2. Run `cd package` to go into the package directory
3. Run `npm publish` to publish the package to NPM

---
_Source: https://npm.io/package/svelte-on-fire · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
