# node-oauth

> A node.js client for OAuth API

Latest version **0.3.0** (published 2021-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-oauth
pnpm add node-oauth
yarn add node-oauth
bun add node-oauth
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-04-09 |
| First published | 2011-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.21 |
| Dependencies | 0 |
| Unpacked size | 46.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Yoshitaka Sakamoto |
| Maintainers | ystskm |
| Keywords | oauth, oauth2 |

## Links

- npm: https://www.npmjs.com/package/node-oauth
- Repository: https://github.com/ystskm/node-oauth
- Homepage: https://github.com/ystskm/node-oauth#readme
- Issues: https://github.com/ystskm/node-oauth/issues
- npm.io page: https://npm.io/package/node-oauth

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@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
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2021-04-09
- 0.1.3 — 2013-04-16
- 0.1.2 — 2013-04-15
- 0.1.1 — 2013-04-15
- 0.1.0 — 2011-08-04

## README

#:: node-oauth ::

##Abstract
#### An adaptor for OAuth 1.0 and OAuth 2.0 API.

##Install##

To install the most recent release from [npm](http://npmjs.org/), run:

	npm install node-oauth

##Usage##

> require `node-oauth`  

	var OAuth = require('node-oauth');

> set your application OAuth setting file.  

	OAuth = OAuth("../sample/object-oauth.js")

> jump to Login page.  
> "response" is necessary for redirect.  

	OAuth.authorize('facebook',{
	    response: res,
	    endCallback: function(err) {
	      if(err)
	        onError(err);
	    }
	  });

> (OAuth 1.0)  
> if you don't want to go authorize page everytime, you can control after getting request token.  
> Authorizer object returns. It have setting datas on its fields.  

	var oauthAuthorizer = OAuth.authorize('twitter', {
	    auto: false
	  });

> get access token in redirect page  
> Tokener object returns.  

	var oauthTokener = OAuth.access(oauth['type'], {
	  href: location.href
	}, authorized);

> if you want to set access_token externaly, ( that is , not via url )  

	oauthTokener.set({
	  request_token: oauth['req_tkn'],
	  access_token: oauth['oac_tkn'],
	  access_token_secret: oauth['oac_tkn_scr']
	});

> access to api with name (set in setting file) / url.   
> data returns after JSON.parse(api-response).  

	oauthTokener.get("credentials", {}, function(err, data){
	  if(err)
	    return ...
	  ...
	  });

##Change Log##

* 2013/4/16
	+ 0.1.2 release  
	+ repository owner is changed to ystskm

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