# x-cite-firebase-sdk

> Readme file

Latest version **1.0.3** (published 2019-11-07) · 0 weekly downloads

## Install

```sh
npm install x-cite-firebase-sdk
pnpm add x-cite-firebase-sdk
yarn add x-cite-firebase-sdk
bun add x-cite-firebase-sdk
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-11-07 |
| First published | 2019-11-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 979.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | jameleddine |
| Maintainers | makremzitoun |
| Keywords | mapGL, react-mapbox-gl, x-cite |

## Links

- npm: https://www.npmjs.com/package/x-cite-firebase-sdk
- npm.io page: https://npm.io/package/x-cite-firebase-sdk

## Dependencies (2)

- [webpack](https://npm.io/package/webpack.md) ^2.6.1
- [firebase](https://npm.io/package/firebase.md) ^5.6.0

## Recent versions

- 1.0.3 (latest) — 2019-11-07
- 1.0.2 — 2019-11-07
- 1.0.1 — 2019-11-07
- 1.0.0 — 2019-11-07

## README

### Installation



```sh
$ npm install x-cite-firebase-sdk
```
```sh
$ yarn add x-cite-firebase-sdk
```

then import the package into the used component

```
import Firebase from 'x-cite-firebase-sdk'
```
### Configuration

```Auth API 

  doCreateUserWithEmailAndPassword(email, password) {
    this.auth.createUserWithEmailAndPassword(email, password);
  }


  doSignInWithEmailAndPassword(email, password) { this.auth.signInWithEmailAndPassword(email, password); }


  doSignInWithGoogle() { this.auth.signInWithPopup(this.googleProvider); }


  doSignInWithFacebook() { this.auth.signInWithPopup(this.facebookProvider); }


  doSignInWithTwitter() { this.auth.signInWithPopup(this.twitterProvider); }


  doSignOut() { this.auth.signOut(); }


  doPasswordReset (email) {
    this.auth.sendPasswordResetEmail(email);}

  doSendEmailVerification() {
    this.auth.currentUser.sendEmailVerification({
      url: process.env.REACT_APP_CONFIRMATION_EMAIL_REDIRECT,
    });
  }


  doPasswordUpdate(password) {
    this.auth.currentUser.updatePassword(password);

    // *** Merge Auth and DB User API *** //

    onAuthUserListener(next, fallback)
    this.auth.onAuthStateChanged(authUser => {
      if (authUser) {
        this.user(authUser.uid)
          .once('value')
          .then(snapshot => {
            const dbUser = snapshot.val();

            // default empty roles
            if (!dbUser.roles) {
              dbUser.roles = {};
            }

            // merge auth and db user
            authUser = {
              uid: authUser,
              email: authUser.email,
              emailVerified: authUser.emailVerified,
              providerData: authUser.providerData,
              ...dbUser,
            };

            next(authUser);
          });
      } else {
        fallback();
      }
    });
  }

  ```User API 

  user(uid) {
    this.db.ref(`users/${uid}`);
  }

  users() {
    this.db.ref('users');
  }

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