# firebase-sign-in-with-ethereum

> Asynchronously signs in using an Ethereum address

Latest version **1.0.3** (published 2022-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-sign-in-with-ethereum
pnpm add firebase-sign-in-with-ethereum
yarn add firebase-sign-in-with-ethereum
bun add firebase-sign-in-with-ethereum
```

## 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 | 2022-01-28 |
| First published | 2022-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 179 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 (+12 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Jonathan Delgado |
| Maintainers | jondotsoy |
| Keywords | firebase, sign-in, ethereum |

## Links

- npm: https://www.npmjs.com/package/firebase-sign-in-with-ethereum
- Repository: https://github.com/JonDotsoy/firebase-sign-in-with-ethereum
- Homepage: https://github.com/JonDotsoy/firebase-sign-in-with-ethereum#readme
- Issues: https://github.com/JonDotsoy/firebase-sign-in-with-ethereum/issues
- npm.io page: https://npm.io/package/firebase-sign-in-with-ethereum

## Dependencies (179)

- [q](https://npm.io/package/q.md) ^1.5.1
- [ws](https://npm.io/package/ws.md) ^8.4.2
- [has](https://npm.io/package/has.md) ^1.0.3
- [idb](https://npm.io/package/idb.md) ^3.0.2
- [ini](https://npm.io/package/ini.md) ^1.3.8
- [lie](https://npm.io/package/lie.md) ^3.3.0
- [tmp](https://npm.io/package/tmp.md) ^0.2.1
- [glob](https://npm.io/package/glob.md) ^7.2.0
- [long](https://npm.io/package/long.md) ^4.0.0
- [meow](https://npm.io/package/meow.md) ^8.1.2
- [once](https://npm.io/package/once.md) ^1.4.0
- [pako](https://npm.io/package/pako.md) ^1.0.11
- [pify](https://npm.io/package/pify.md) ^2.3.0
- [tr46](https://npm.io/package/tr46.md) ^0.0.3
- [y18n](https://npm.io/package/y18n.md) ^5.0.8
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [cliui](https://npm.io/package/cliui.md) ^7.0.4
- [dargs](https://npm.io/package/dargs.md) ^7.0.0
- [jszip](https://npm.io/package/jszip.md) ^3.7.1
- [p-try](https://npm.io/package/p-try.md) ^2.2.0
- [split](https://npm.io/package/split.md) ^1.0.1
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [xtend](https://npm.io/package/xtend.md) ^4.0.2
- [yargs](https://npm.io/package/yargs.md) ^16.2.0
- [arrify](https://npm.io/package/arrify.md) ^1.0.1
- [is-obj](https://npm.io/package/is-obj.md) ^2.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [redent](https://npm.io/package/redent.md) ^3.0.0
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [semver](https://npm.io/package/semver.md) ^7.3.5
- [split2](https://npm.io/package/split2.md) ^3.2.2
- [wrappy](https://npm.io/package/wrappy.md) ^1.0.2
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [figures](https://npm.io/package/figures.md) ^3.2.0
- [find-up](https://npm.io/package/find-up.md) ^5.0.0
- [isarray](https://npm.io/package/isarray.md) ^1.0.0
- [kind-of](https://npm.io/package/kind-of.md) ^6.0.3
- [map-obj](https://npm.io/package/map-obj.md) ^4.3.0
- [p-limit](https://npm.io/package/p-limit.md) ^3.1.0
- [resolve](https://npm.io/package/resolve.md) ^1.22.0
- [through](https://npm.io/package/through.md) ^2.3.8
- [yallist](https://npm.io/package/yallist.md) ^4.0.0
- [dot-prop](https://npm.io/package/dot-prop.md) ^5.3.0
- [error-ex](https://npm.io/package/error-ex.md) ^1.3.2
- [escalade](https://npm.io/package/escalade.md) ^3.1.1
- [firebase](https://npm.io/package/firebase.md) ^9.6.5
- [has-flag](https://npm.io/package/has-flag.md) ^3.0.0
- [inflight](https://npm.io/package/inflight.md) ^1.0.6
- [inherits](https://npm.io/package/inherits.md) ^2.0.4
- [minimist](https://npm.io/package/minimist.md) ^1.2.5
- [p-locate](https://npm.io/package/p-locate.md) ^5.0.0
- [read-pkg](https://npm.io/package/read-pkg.md) ^3.0.0
- [through2](https://npm.io/package/through2.md) ^4.0.2
- [wordwrap](https://npm.io/package/wordwrap.md) ^1.0.0
- [array-ify](https://npm.io/package/array-ify.md) ^1.0.0
- [camelcase](https://npm.io/package/camelcase.md) ^5.3.1
- [fs-access](https://npm.io/package/fs-access.md) ^1.0.1
- [immediate](https://npm.io/package/immediate.md) ^3.0.6
- [js-tokens](https://npm.io/package/js-tokens.md) ^4.0.0
- [jsonparse](https://npm.io/package/jsonparse.md) ^1.3.1
- [lru-cache](https://npm.io/package/lru-cache.md) ^6.0.0
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [neo-async](https://npm.io/package/neo-async.md) ^2.6.2
- [path-type](https://npm.io/package/path-type.md) ^3.0.0
- [quick-lru](https://npm.io/package/quick-lru.md) ^4.0.1
- [strip-bom](https://npm.io/package/strip-bom.md) ^3.0.0
- [type-fest](https://npm.io/package/type-fest.md) ^0.18.1
- [uglify-js](https://npm.io/package/uglify-js.md) ^3.15.0
- [wrap-ansi](https://npm.io/package/wrap-ansi.md) ^7.0.0
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.3.5
- [add-stream](https://npm.io/package/add-stream.md) ^1.0.0
- [ansi-regex](https://npm.io/package/ansi-regex.md) ^5.0.1
- [color-name](https://npm.io/package/color-name.md) ^1.1.4
- [concat-map](https://npm.io/package/concat-map.md) ^0.0.1
- [dateformat](https://npm.io/package/dateformat.md) ^3.0.3
- [decamelize](https://npm.io/package/decamelize.md) ^1.2.0
- [handlebars](https://npm.io/package/handlebars.md) ^4.7.7
- [min-indent](https://npm.io/package/min-indent.md) ^1.0.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [null-check](https://npm.io/package/null-check.md) ^1.0.0
- [parse-json](https://npm.io/package/parse-json.md) ^4.0.0
- [path-parse](https://npm.io/package/path-parse.md) ^1.0.7
- [protobufjs](https://npm.io/package/protobufjs.md) ^6.11.2
- [source-map](https://npm.io/package/source-map.md) ^0.6.1
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^6.0.1
- [typedarray](https://npm.io/package/typedarray.md) ^0.0.6
- [whatwg-url](https://npm.io/package/whatwg-url.md) ^5.0.0
- [ansi-styles](https://npm.io/package/ansi-styles.md) ^4.3.0
- [buffer-from](https://npm.io/package/buffer-from.md) ^1.1.2
- [emoji-regex](https://npm.io/package/emoji-regex.md) ^8.0.0
- [fs.realpath](https://npm.io/package/fs.realpath.md) ^1.0.0
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.2.9
- [is-arrayish](https://npm.io/package/is-arrayish.md) ^0.2.1
- [locate-path](https://npm.io/package/locate-path.md) ^6.0.0
- [path-exists](https://npm.io/package/path-exists.md) ^4.0.0
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^3.0.0
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.1.2
- [yocto-queue](https://npm.io/package/yocto-queue.md) ^0.1.0
- [compare-func](https://npm.io/package/compare-func.md) ^2.0.0
- [core-util-is](https://npm.io/package/core-util-is.md) ^1.0.3
- [dotgitignore](https://npm.io/package/dotgitignore.md) ^2.1.0
- [get-pkg-repo](https://npm.io/package/get-pkg-repo.md) ^4.2.1
- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^1.1.0
- [is-text-path](https://npm.io/package/is-text-path.md) ^1.0.1
- [spdx-correct](https://npm.io/package/spdx-correct.md) ^3.1.1
- [string-width](https://npm.io/package/string-width.md) ^4.2.3
- [strip-indent](https://npm.io/package/strip-indent.md) ^3.0.0
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^2.0.4
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^20.2.9
- [color-convert](https://npm.io/package/color-convert.md) ^2.0.1
- [concat-stream](https://npm.io/package/concat-stream.md) ^2.0.0
- [detect-indent](https://npm.io/package/detect-indent.md) ^6.1.0
- [function-bind](https://npm.io/package/function-bind.md) ^1.1.1
- [indent-string](https://npm.io/package/indent-string.md) ^4.0.0
- [modify-values](https://npm.io/package/modify-values.md) ^1.0.1
- [trim-newlines](https://npm.io/package/trim-newlines.md) ^3.0.1
- [balanced-match](https://npm.io/package/balanced-match.md) ^1.0.2
- [camelcase-keys](https://npm.io/package/camelcase-keys.md) ^6.2.2
- [detect-newline](https://npm.io/package/detect-newline.md) ^3.1.0
- [faye-websocket](https://npm.io/package/faye-websocket.md) ^0.11.4
- [gitconfiglocal](https://npm.io/package/gitconfiglocal.md) ^1.0.0
- [hard-rejection](https://npm.io/package/hard-rejection.md) ^2.1.0
- [http-parser-js](https://npm.io/package/http-parser-js.md) ^0.5.5
- [is-core-module](https://npm.io/package/is-core-module.md) ^2.8.1
- [load-json-file](https://npm.io/package/load-json-file.md) ^4.0.0
- [lodash.ismatch](https://npm.io/package/lodash.ismatch.md) ^4.4.0
- [string_decoder](https://npm.io/package/string_decoder.md) ^1.1.1
- [supports-color](https://npm.io/package/supports-color.md) ^5.5.0
- [util-deprecate](https://npm.io/package/util-deprecate.md) ^1.0.2
- [brace-expansion](https://npm.io/package/brace-expansion.md) ^1.1.11
- [decamelize-keys](https://npm.io/package/decamelize-keys.md) ^1.1.0
- [get-caller-file](https://npm.io/package/get-caller-file.md) ^2.0.5
- [git-raw-commits](https://npm.io/package/git-raw-commits.md) ^2.0.11
- [git-semver-tags](https://npm.io/package/git-semver-tags.md) ^4.1.1
- [hosted-git-info](https://npm.io/package/hosted-git-info.md) ^4.1.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.3.7
- [spdx-exceptions](https://npm.io/package/spdx-exceptions.md) ^2.3.0
- [text-extensions](https://npm.io/package/text-extensions.md) ^1.9.0
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [minimist-options](https://npm.io/package/minimist-options.md) ^4.1.0
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.1
- [promise-polyfill](https://npm.io/package/promise-polyfill.md) ^8.1.3
- [spdx-license-ids](https://npm.io/package/spdx-license-ids.md) ^3.0.11
- [websocket-driver](https://npm.io/package/websocket-driver.md) ^0.7.4
- [lines-and-columns](https://npm.io/package/lines-and-columns.md) ^1.2.4
- [require-directory](https://npm.io/package/require-directory.md) ^2.1.1
- [stringify-package](https://npm.io/package/stringify-package.md) ^1.0.1
- [selenium-webdriver](https://npm.io/package/selenium-webdriver.md) ^4.0.0-rc-1
- [set-immediate-shim](https://npm.io/package/set-immediate-shim.md) ^1.0.1
- [webidl-conversions](https://npm.io/package/webidl-conversions.md) ^3.0.1
- [json-stringify-safe](https://npm.io/package/json-stringify-safe.md) ^5.0.1
- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^1.0.5
- [process-nextick-args](https://npm.io/package/process-nextick-args.md) ^2.0.1
- [websocket-extensions](https://npm.io/package/websocket-extensions.md) ^0.1.4
- [git-remote-origin-url](https://npm.io/package/git-remote-origin-url.md) ^2.0.0
- [spdx-expression-parse](https://npm.io/package/spdx-expression-parse.md) ^3.0.1
- [conventional-changelog](https://npm.io/package/conventional-changelog.md) ^3.1.24
- [normalize-package-data](https://npm.io/package/normalize-package-data.md) ^3.0.3
- [is-fullwidth-code-point](https://npm.io/package/is-fullwidth-code-point.md) ^3.0.0
- [json-parse-better-errors](https://npm.io/package/json-parse-better-errors.md) ^1.0.2
- [conventional-changelog-atom](https://npm.io/package/conventional-changelog-atom.md) ^2.0.8
- [conventional-changelog-core](https://npm.io/package/conventional-changelog-core.md) ^4.2.4
- [conventional-commits-filter](https://npm.io/package/conventional-commits-filter.md) ^2.0.7
- [conventional-commits-parser](https://npm.io/package/conventional-commits-parser.md) ^3.2.4
- [conventional-changelog-ember](https://npm.io/package/conventional-changelog-ember.md) ^2.0.9
- [validate-npm-package-license](https://npm.io/package/validate-npm-package-license.md) ^3.0.4
- [conventional-changelog-eslint](https://npm.io/package/conventional-changelog-eslint.md) ^3.0.9
- [conventional-changelog-jquery](https://npm.io/package/conventional-changelog-jquery.md) ^3.0.11
- [conventional-changelog-jshint](https://npm.io/package/conventional-changelog-jshint.md) ^2.0.9
- [conventional-changelog-writer](https://npm.io/package/conventional-changelog-writer.md) ^5.0.1
- [conventional-recommended-bump](https://npm.io/package/conventional-recommended-bump.md) ^6.1.0
- [json-parse-even-better-errors](https://npm.io/package/json-parse-even-better-errors.md) ^2.3.1
- [conventional-changelog-angular](https://npm.io/package/conventional-changelog-angular.md) ^5.0.13
- [conventional-changelog-express](https://npm.io/package/conventional-changelog-express.md) ^2.0.6
- [supports-preserve-symlinks-flag](https://npm.io/package/supports-preserve-symlinks-flag.md) ^1.0.0
- [conventional-changelog-codemirror](https://npm.io/package/conventional-changelog-codemirror.md) ^2.0.8
- [conventional-changelog-config-spec](https://npm.io/package/conventional-changelog-config-spec.md) ^2.1.0
- [conventional-changelog-preset-loader](https://npm.io/package/conventional-changelog-preset-loader.md) ^2.3.4
- [conventional-changelog-conventionalcommits](https://npm.io/package/conventional-changelog-conventionalcommits.md) ^4.6.1

## Recent versions

- 1.0.3 (latest) — 2022-01-28
- 1.0.2 — 2022-01-28
- 1.0.1 — 2022-01-28
- 1.0.0 — 2022-01-28

## README

## firebase-sign-in-with-ethereum

Asynchronously signs in using an Ethereum address.

Use the ethereum address in your wallet (MetaMask) to sign the credentials used to sign in with the Firebase Auth SDK.

> Note: This strategy use the `signInWithEmailAndPassword` method of the Firebase Auth SDK.

## Install the package

Install the firebase-sign-in-with-ethereum npm module:

```sh
npm i firebase firebase-sign-in-with-ethereum
```

## Use in you project

1. Call the `signInWithEthereum` method and indicate the auth instance of the Firebase SDK.

```ts
import { signInWithEthereum } from "firebase-sign-in-with-ethereum";
import { getAuth } from "firebase/auth";

const auth = getAuth();

signInWithEthereum(auth)
  .then((userCredential) => {
    // Signed in 
    const user = userCredential.user;
    // ...
  })
  .catch((error) => {
    const errorCode = error.code;
    const errorMessage = error.message;
    // ..
  });
```

2. The next step is to grant to the read address permission from your Ethereum wallet.

![grant access](./assets/grant-access-to-address.png)

3. The next step is sign the message with your Ethereum wallet.

![Sign message](assets/sign-message.png)


## Changelog

Can be found in [CHANGELOG](./CHANGELOG.md)

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