This repository has been archived by the owner. It is now read-only.
npm module for get the Twitter API tokens.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
__tests__
manual_tests
src
.eslintrc.json
.gitignore
README.md
package.json

README.md

⚠️This package is currently not maintained.⚠️

twitter-sign

You can easily get the Twitter API signature.

Install

$ npm install --save twitter-sign

Usage

const sign = require('twitter-sign');
// case of requet-token
const { requestUrl, headers }
  = sign.getRequestTokenSign(apiKey, apiSecret, callbackUrl);
// case of access-token
const { requestUrl, headers }
  = sign.getAccessTokenSign(apiKey, apiSecret, requestTokenSecret, oauthToken, oauthVerifier)

You just throw Post method to the URL you obtained.
Don't forget to attach the acquired header.

Case using Request module

request.post({ url: requestUrl, headers }, (error, response) => {
  // You can confirm tokens.
  console.log(response.body);
});