Twitter Login. OAuth 1.0 flow
Selling Point
This package can be used to get Twitter user access token using oAuth 1.0 flow.
Implements a Client-Side flow for login with twitter, similar to one provided by Facebook and Google. This can be used to get User Access Token to make API calls to Twitter where User Context is required
Installation:
-
Clone as a Git repository
git clone https://github.com/knitesh/twitter-login.git -
Install as a node_module
npm i twitter-login --saveORnpm install twitter-login --save
Usage
To start twitter Login process
await twitter
To get user details
await twitter
Sample Express app
const express = const session = const TwitterLogin = const app = const port = 9000 const sessionConfig = user: null tokenSecret: null secret: 'keyboard cat' app // get consumer key and consumer secret from Twitter App settingconst twitter = consumerKey: '<your api key>' consumerSecret: '<your api secret key>' callbackUrl: 'http://localhost:$port/twitter/auth/userToken' // Route where user will get directed on clicking on Login buttonapp // Callback Route to retreive user auth token and secret// This needs to be whitelisted in your twitter appapp app app