# @use-firebase/app

> A custom React Hook that provides a declarative interface for Firebase.

Latest version **0.3.3** (published 2020-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @use-firebase/app
pnpm add @use-firebase/app
yarn add @use-firebase/app
bun add @use-firebase/app
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2020-08-28 |
| First published | 2019-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Donavon West |
| Maintainers | donavon |
| Keywords | react-hooks, hooks, react, utils, lib, firebase |

## Links

- npm: https://www.npmjs.com/package/@use-firebase/app
- Repository: https://github.com/donavon/use-firebase-app
- Homepage: https://github.com/donavon/use-firebase-app#readme
- Issues: https://github.com/donavon/use-firebase-app/issues
- npm.io page: https://npm.io/package/@use-firebase/app

## Dependencies (2)

- [firebase](https://npm.io/package/firebase.md) ^7.19.1
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.3.3 (latest) — 2020-08-28
- 0.3.2 — 2019-03-08
- 0.3.1 — 2019-03-05
- 0.3.0 — 2019-03-05
- 0.2.0 — 2019-02-18
- 0.1.0 — 2019-02-17

## README

# @use-firebase/app

A custom React Hook that impliments Firebase's App object.

[![npm version](https://badge.fury.io/js/%40use-firebase%2Fapp.svg)](https://badge.fury.io/js/%40use-firebase%2Fapp)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)

## Installation

```bash
$ npm i @use-firebase/app
```

or

```bash
$ yarn add @use-firebase/app
```

## API

You must first import the package like so.

```js
import { FirebaseAppProvider, useFirebaseApp } from '@use-firebase/app';
```

### FirebaseAppProvider

Return a Firebase application provider. You must wrap your app inside
of an `<FirebaseAppProvider/>`.

```jsx
<FirebaseAppProvider config={myFirebaseConfig} name="myFirebase">
  <App />
</FirebaseAppProvider>
```

#### Props

Here are the parameters that you can use.

| Parameter | Description                                                                                         |
| :-------- | :-------------------------------------------------------------------------------------------------- |
| `config`  | A configuration object. See below for instructions on how to obtain this from the Firebase console. |
| `name` | An optional name for your app. Default = `[DEFAULT]`.                                 |

##### Obtaining `config` information from the Firebase console

1. Go to your project page on the [Firebase console](https://console.firebase.google.com).
1. Next to `Project Overview` you should see a gear icon.
1. Click it and select `Project settings` from the menu.
1. On the `General` tab, you should see a `Your apps` section.
1. Click on the web icon (i.e. `</>`)
1. Copy just the `var config` information and not any of the HTML tags. It should look somthing like this.

```js
var config = {
  apiKey: 'AIzaSy7IGdsxh_8XNxKn6H4d9yKBH5qnD_B2xbs',
  authDomain: 'my-app-87543.firebaseapp.com',
  databaseURL: 'https://my-app-87543.firebaseio.com',
  projectId: 'my-app-87543',
  storageBucket: 'my-app-87543.appspot.com',
  messagingSenderId: '423450585517',
};
```

### useFirebaseApp

```js
const app = useFirebaseApp();
```

`useFirebaseApp` is a custom hook that you can use in your components to
obtain the `app` object created by `FirebaseAppProvider`.

## Live demo

TODO

## License

**[MIT](LICENSE)** Licensed

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