# nexus-plugin-firebase

> A Nexus framework plugin for Firebase

Latest version **0.1.2** (published 2020-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install nexus-plugin-firebase
pnpm add nexus-plugin-firebase
yarn add nexus-plugin-firebase
bun add nexus-plugin-firebase
```

## 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.1.2 |
| Published | 2020-09-06 |
| First published | 2020-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jordon McKoy |
| Maintainers | jordon.mckoy |

## Links

- npm: https://www.npmjs.com/package/nexus-plugin-firebase
- Repository: https://github.com/jordonmckoy/nexus-plugin-firebase
- Homepage: https://github.com/jordonmckoy/nexus-plugin-firebase#readme
- Issues: https://github.com/jordonmckoy/nexus-plugin-firebase/issues
- npm.io page: https://npm.io/package/nexus-plugin-firebase

## Dependencies (1)

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

## Recent versions

- 0.1.2 (latest) — 2020-09-06
- 0.1.1 — 2020-07-24
- 0.1.0 — 2020-07-23

## README

# nexus-plugin-firebase <!-- omit in toc -->

**Contents**

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Installation](#installation)
- [Example Usage](#example-usage)
- [What is nexus-plugin-firebase](#what-is-nexus-plugin-firebase)
- [Worktime Contributions](#worktime-contributions)
- [Runtime Contributions](#runtime-contributions)
- [Testtime Contributions](#testtime-contributions)
- [Links](#links)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->


## Installation

```
npm install nexus-plugin-firebase
```


## Example Usage
> Ensure the GOOGLE_APPLICATION_CREDENTIALS env is set

```js
import { firebase } from 'nexus-plugin-firebase';

use(prisma());
use(
  firebase({
    databaseURL: 'https://my-firebase-project.firebaseio.com',
  })
);

/* ... */

schema.mutationType({
  definition(t) {
    t.field('signup', {
      type: 'AuthPayload',
      args: {
        firstName: schema.stringArg({ nullable: false }),
        email: schema.stringArg({ nullable: false }),
        password: schema.stringArg({ nullable: false }),
      },
      resolve: async (
        _parent,
        { firstName, email, password },
        ctx
      ) => {
          ctx.admin.auth().createUser({
            email,
            emailVerified: false,
            password,
            displayName: `${firstName}`,
            disabled: false,
          }).then(function(userRecord) {
            console.log('Successfully created new user:', userRecord.uid);
          }).catch(function(error) {
            console.log('Error creating new user:', error);
          });
      },
    });
  }
});
```


## What is nexus-plugin-firebase

The quickest and easiest way to get started with Firebase and Nexus. This plugin is a wrapper around the firebase-admin package. It exposes the Firebase admin object through resolver context, providing full access to the firebase-admin API.


## Worktime Contributions

TODO

## Runtime Contributions

TODO

## Testtime Contributions

TODO


## Links

https://nexusjs.org

https://firebase.google.com/docs/auth/admin

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