# @ourway/svelte-firebase-auth

> A library for using firebase authentication in svelte projects.

Latest version **0.0.4** (published 2024-04-03) · GPLv3 license · 0 weekly downloads

## Install

```sh
npm install @ourway/svelte-firebase-auth
pnpm add @ourway/svelte-firebase-auth
yarn add @ourway/svelte-firebase-auth
bun add @ourway/svelte-firebase-auth
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2024-04-03 |
| First published | 2023-11-08 |
| Weekly downloads | 0 |
| License | GPLv3 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 40 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrew Blackledge, Alex Nicolaou |
| Maintainers | implode963, anicolao |
| Keywords | firebase, auth, svelte |

## Links

- npm: https://www.npmjs.com/package/@ourway/svelte-firebase-auth
- Repository: https://github.com/AndrewBlackledge/svelte-firebase-auth
- Homepage: https://github.com/AndrewBlackledge/svelte-firebase-auth#readme
- Issues: https://github.com/AndrewBlackledge/svelte-firebase-auth/issues
- npm.io page: https://npm.io/package/@ourway/svelte-firebase-auth

## Dependencies (1)

- [@firebase/auth](https://npm.io/package/@firebase/auth.md) ^1.3.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2024-04-03
- 0.0.3 — 2024-04-03
- 0.0.2 — 2024-04-03
- 0.0.1 — 2023-11-08

## README

# svelte-firebase-auth
Auth with firebase for svelte projects.


In order to use firebase for authentication, you first need
to go to the firebase console and add an app with the authentication
methods you want to support enabled. During the process of adding the
app you should get a snippet of JavaScript code that defines a 
`firebaseConfig` variable with the settings that you need in order
to call the `getApp()` and `getAuth()` APIs.  Put this snippet inside
`${lib}/firebase.ts`.

Then, sample code like this should work, and you need to decide 
what you want to happen on user sign in / sign out inside the 
custom event fired by the sign in button.

```ts
<script lang="ts">
    import { GoogleAuthProvider, getAuth } from "@firebase/auth";
    import { initializeApp } from "@firebase/app";
    import { Signin } from "@ourway/svelte-firebase-auth";
    import { firebaseConfig } from "$lib/firebase";

    const app = initializeApp(firebaseConfig);
    const auth = getAuth(app);
    console.log("AUTH: ", auth)
    const googleAuthProvider = new GoogleAuthProvider();

    function user(e: CustomEvent) {
        console.log("CUSTOM EVENT: ",e);
    }
</script>

<h1>Cluster</h1>
<p>Please sign in.</p>
<Signin {auth} {googleAuthProvider} on:user_changed={user}/>

```

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