# electron-authentication-hatena

> Hatena OAuth Window library.

Latest version **3.0.1** (published 2019-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install electron-authentication-hatena
pnpm add electron-authentication-hatena
yarn add electron-authentication-hatena
bun add electron-authentication-hatena
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2019-01-07 |
| First published | 2015-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | azu |
| Maintainers | azu |
| Keywords | electron, hatena, oauth |

## Links

- npm: https://www.npmjs.com/package/electron-authentication-hatena
- Repository: https://github.com/azu/electron-authentication-hatena
- Issues: https://github.com/azu/electron-authentication-hatena/issues
- npm.io page: https://npm.io/package/electron-authentication-hatena

## Dependencies (2)

- [oauth](https://npm.io/package/oauth.md) ^0.9.14
- [@types/oauth](https://npm.io/package/@types/oauth.md) ^0.9.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

- 3.0.1 (latest) — 2019-01-07
- 3.0.0 — 2019-01-07
- 2.0.1 — 2016-02-16
- 2.0.0 — 2015-12-29
- 1.0.4 — 2015-09-24
- 1.0.3 — 2015-09-24
- 1.0.2 — 2015-09-24
- 1.0.1 — 2015-09-24

## README

# electron-authentication-hatena [![Build Status](https://travis-ci.org/azu/electron-authentication-hatena.svg?branch=master)](https://travis-ci.org/azu/electron-authentication-hatena)

This [Electron](http://electron.atom.io/ "Electron") library that help to login by OAuth for Hatena.

はてなサービス(はてなブックマークなど)のAPI利用に必要なOAuth認証を行うライブラリです。

- http://developer.hatena.ne.jp/ja/documents/auth/apis/oauth

## Installation

    npm install electron-authentication-hatena

## Usage

![screenshot](https://monosnap.com/file/MLylHNva1bcWgIWOx88gd8C19RtZ5L.png)

See [example](example/) app.

```
npm run example
```

Code:

```js
const electron = require('electron');
const dialog = electron.dialog;

const CONSUMER = {
    key: '______',
    secret: '_______'
};
const AuthenticationHatena = require("electron-authentication-hatena").AuthenticationHatena;
// http://developer.hatena.com/ja/documents/auth/apis/oauth/consumer
const hatena = new AuthenticationHatena({
    key: CONSUMER.key,
    secret: CONSUMER.secret,
    scopes: ["read_public", "write_public"]
});
hatena.startRequest().then(function (result) {
    var accessToken = result.accessToken;
    var accessTokenSecret = result.accessTokenSecret;
    dialog.showErrorBox("Status", "Token: " + accessToken + "\nSecret: " + accessTokenSecret);
    console.log(accessToken, accessTokenSecret);
}).catch(function (error) {
    console.error(error, error.stack);
});

```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT

## Acknowledgement

- http://qiita.com/Quramy/items/fc79cad92bb287478076

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