request-oauth

    1.0.1 • Public • Published

    request-oauth

    npm-version travis-ci coveralls-status

    OAuth 1.0a support for request-compose

    var request = require('request-compose').extend({
      Request: {oauth: require('request-oauth')}
    }).client
    
    ;(async () => {
      try {
        var {res, body} = await request({
          url: 'https://api.twitter.com/1.1/users/show.json',
          qs: {
            screen_name: '[SCREEN NAME]'
          },
          oauth: {
            consumer_key: '[APP ID]',
            consumer_secret: '[APP SECRET]',
            token: '[ACCESS TOKEN]',
            token_secret: '[ACCESS SECRET]',
          }
        })
        console.log(body)
      }
      catch (err) {
        console.error(err)
      }
    })()

    Options

    Option Description
    Required
    consumer_key OAuth application key
    consumer_secret OAuth application secret
    private_key in PEM format, set this key instead of consumer_secret when using RSA-SHA1 signing
    token user's access token
    token_secret user's token secret
    Defaults
    version 1.0
    signature_method HMAC-SHA1, RSA-SHA1, PLAINTEXT
    transport_method header, query, form
    Generated
    timestamp
    nonce
    signature
    Optional
    realm
    body_hash body hash string to use or true to get one generated for you

    Install

    npm i request-oauth

    DownloadsWeekly Downloads

    77,181

    Version

    1.0.1

    License

    Apache-2.0

    Unpacked Size

    16.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • simov