/electron-oauth-twitter

This is Electron module that OAuth authenticates your Electron app with Twitter

Primary LanguageJavaScriptMIT LicenseMIT

electron-oauth-twitter

This is Electron module that easily OAuth authenticates your Electron app with twitter.

Install

npm install electron-oauth-twitter

Diving into OAuth

  1. Register your app.

  2. You need Consumer Key (API Key) and Consumer Secret (API Secret).

  3. Set Callback URL at settings of you app. If you do not set Callback URL, it will evoke PIN Based OAuth.

  1. Edit your Electron main file. See example. Dive into OAuth!
var dialog = require('electron').dialog;

var OauthTwitter = require('electron-oauth-twitter');

var twitter = new OauthTwitter({
  key: '****',
  secret: '****',
});

twitter.startRequest().then(function(result) {
  var accessToken = result.oauth_access_token;
  var accessTokenSecret = result.oauth_access_token_secret;
  dialog.showErrorBox('Status', 'Token: ' + accessToken + '\nSecret: ' + accessTokenSecret);
}).catch(function(error) {
  console.error(error, error.stack);
});

MIT licensed