Giter Site home page Giter Site logo

dondoko-susumu / react-twitter-login Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexandrtovmach/react-twitter-login

1.0 1.0 0.0 1.41 MB

Twitter OAuth with React

Home Page: https://alexandrtovmach.github.io/react-twitter-login/

License: MIT License

TypeScript 92.81% JavaScript 7.19%

react-twitter-login's Introduction

react-twitter-login

npm npm bundle size npm

React component for a simple OAuth login with Twitter.

DEMO HERE

image

๐Ÿš€ Get Started

Follow these steps to start using React Twitter Login:

  1. Installation

    # with npm
    npm i react-twitter-login
    
    # with yarn
    yarn add react-twitter-login
  2. Import and configure component.

    import React from "react";
    import TwitterLogin from "react-twitter-login";
    
    export default props => {
      const authHandler = (err, data) => {
        console.log(err, data);
      };
    
      return (
        <TwitterLogin
          authCallback={authHandler}
          consumerKey={CONSUMER_KEY}
          consumerSecret={CONSUMER_SECRET}
          callbackUrl={CALLBACK_URL}
        />
      );
    };
  3. Find more info about keys and Twitter developer apps in official docs.

๐Ÿ“– API

Property Type Default Description
authCallback function required Callback function which takes two arguments (error, authData)
consumerKey string required Consumer API Key of your Twitter developer app (not Access Token)
consumerSecret string required Consumer API Secret of your Twitter developer app (not Access Token Secret)
callbackUrl string required Whitelisted callback URL of your Twitter app
buttonTheme enum("light", "light_short", "dark", "dark_short") "light" Button style theme, that based on Twitter Brand Design
className string "" Custom class name
children React.Component "" Provide any component as a "children" prop to use custom button

๐Ÿ“ License

MIT

react-twitter-login's People

Contributors

alexandrtovmach avatar dondoko-susumu avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.