client-oauth

OAuth client library

npm install client-oauth
7 downloads in the last week
26 downloads in the last month

build status

Node.js OAuth Client Library

Install via npm

npm install client-oauth

OAuth 1.0a

Usage

var example = new OAuth[1.0]({
  base: 'http://term.ie/oauth/example',
  key: 'key',
  secret: 'secret'
})

Possible options:

{
  // API endpoint base URL
  base: '',
  // Consumer token
  key: '',
  // Consumer secret
  secret: '',
  // OAuth signature method
  signature_method: 'HMAC-SHA1',
  // HTTP request headers
  headers: {
    'Accept': '*/*',
    'Connection': 'Close',
    'User-Agent': 'node.js/client-oauth'
  }
}
var user = new example.Client()
user.get(
  '/request_token.php', null,
  function( error, data, response ) {
    if( response && response.statusCode ) {
      console.log( response.statusCode )
      console.log( data )
    } else {
      console.log( error )
    }
  }
)
npm loves you