0.0.3 • Published 4 years ago

react-instagram-oauth v0.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

react-instagram-oauth

npm npm bundle size npm

React component for a simple OAuth login with Instagram.

DEMO HERE

button examples

🚀 Get Started

Follow these steps to start using React Instagram Login:

  1. Installation

    # with npm
    npm i react-instagram-oauth
    
    # with yarn
    yarn add react-instagram-oauth
  2. Import and configure component.

    import React from "react";
    import InstagramLogin from "react-instagram-oauth";
    
    export default props => {
      const authHandler = (err, data) => {
        console.log(err, data);
      };
    
      return (
        <InstagramLogin
          authCallback={authHandler}
          appId={CLIENT_ID}
          appSecret={CLIENT_SECRET}
          redirectUri={REDIRECT_URI}
        />
      );
    };
  3. Find more info about keys and OAuth apps in Instagram official docs

📖 API

PropertyTypeDefaultDescription
authCallbackfunctionrequiredCallback function which takes two arguments (error, authData)
appIdstringrequiredApp ID of your OAuth App
appSecretstringrequiredApp Secret of your OAuth App
redirectUristringrequiredAuthorization callback URL of your OAuth App
scopesstring[]["user_profile"]Scopes list. Read more on Permissions page
buttonThemeenum("gradient", "simple", "gradient_short", "simple_short")"gradient"Button style theme
classNamestring""Custom class name

📝 License

MIT