# google-author

> Google Authenticator Secret Keys

Latest version **1.0.4** (published 2024-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install google-author
pnpm add google-author
yarn add google-author
bun add google-author
```

## 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.4 |
| Published | 2024-04-13 |
| First published | 2024-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | bug3 |
| Maintainers | bug3 |
| Keywords | google, authenticator, secret, keys, otp, auth, migration, qr |

## Links

- npm: https://www.npmjs.com/package/google-author
- Repository: https://github.com/bug3/google-author
- Homepage: https://github.com/bug3/google-author#readme
- Issues: https://github.com/bug3/google-author/issues
- npm.io page: https://npm.io/package/google-author

## Dependencies (5)

- [jimp](https://npm.io/package/jimp.md) ^0.22.10
- [base32.js](https://npm.io/package/base32.js.md) ^0.1.0
- [protobufjs](https://npm.io/package/protobufjs.md) ^7.2.5
- [qrcode-reader](https://npm.io/package/qrcode-reader.md) ^1.0.4
- [synchronized-promise](https://npm.io/package/synchronized-promise.md) ^0.3.1

## 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

- 1.0.4 (latest) — 2024-04-13
- 1.0.3 — 2024-01-10
- 1.0.2 — 2024-01-10
- 1.0.1 — 2024-01-10
- 1.0.0 — 2024-01-10

## README

# [google-author](https://github.com/bug3/google-author)

A tool to obtain secret keys from Google Authenticator.

## Installation

```bash
npm install google-author
```

## Usage

-   **Get migration URI from QR code image**:

Google Authenticator App > Transfer accounts > Export accounts > Take screenshot and save file image

```javascript
const googleAuthor = require('google-author');

const qrCodeImageFile = 'qrCode.jpg';

googleAuthor.convertQRCode(qrCodeImageFile).then((migrationURI) => {
    console.log(migrationURI); // otpauth-migration://offline?data=data
}).catch((error) => {
    console.error(error);
});
```
OR

```javascript
const googleAuthor = require('google-author');

const qrCodeImageFile = 'qrCode.jpg';

console.log(googleAuthor.convertQRCodeSync(qrCodeImageFile)); // otpauth-migration://offline?data=data
```

-   **Get secret data**:

```javascript
const googleAuthor = require('google-author');

const migrationURI = 'otpauth-migration://offline?data=data';

googleAuthor.decodeMigrationURI(migrationURI).then((data) => {
    console.log(data);
    /*
    [
        {
            secret: 'aWtpIGtpxZ9pbmluIGJpbGRpxJ9pIHPEsXIgZGXEn2lsZGly',
            name: 'test@email.com',
            issuer: 'bug3',
            hash: 'SHA1',
            digits: 'SIX',
            type: 'TOTP',
            sharedSecret: 'SECRET'
        },
        ...
    ]
    */
}).catch((error) => {
    console.error(error);
});
```

OR

```javascript
const googleAuthor = require('google-author');

const migrationURI = 'otpauth-migration://offline?data=data';

console.log(googleAuthor.decodeMigrationURISync(migrationURI));
/*
[
    {
        secret: 'aWtpIGtpxZ9pbmluIGJpbGRpxJ9pIHPEsXIgZGXEn2lsZGly',
        name: 'test@email.com',
        issuer: 'bug3',
        hash: 'SHA1',
        digits: 'SIX',
        type: 'TOTP',
        sharedSecret: 'SECRET'
    },
    ...
]
*/
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

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