Git Product home page Git Product logo

react-instagram-login's Introduction

React Instagram Login

An Instagram oAUth Sign-in / Log-in Component for React

Install

npm install react-instagram-login

How to use

import React from 'react';
import ReactDOM from 'react-dom';
import InstagramLogin from 'react-instagram-login';

const responseInstagram = (response) => {
  console.log(response);
}

ReactDOM.render(
  <InstagramLogin
    clientId="5fd2f11482844c5eba963747a5f34556"
    buttonText="Login"
    onSuccess={responseInstagram}
    onFailure={responseInstagram}
  />,
  document.getElementById('instagramButton')
);

onSuccess callback

Callback will return a code for use on your server to get a full access_token.

If implicitAuth is set to true it will return the full access_token directly.

onFailure callback

Callback will return an error object.

property name value
error string
error_reason string
error_description string

Parameters

params value default value
clientId string REQUIRED
scope string basic
onSuccess function REQUIRED
onFailure function REQUIRED
buttonText string Login with Instagram
cssClass string -
tag string button
type string button
implicitAuth boolean false

Instagram API Docs: https://www.instagram.com/developer/

You can now also pass child components such as icons into the button component.

  <InstagramLogin
    clientId="5fd2f11482844c5eba963747a5f34556"
    onSuccess={responseInstagram}
    onFailure={responseInstagram}
  >
    <FontAwesome
      name="instagram"
    />
    <span> Login with Instagram</span>
  </InstagramLogin>

Dev Server

npm run start

Run Tests

npm run test:watch

Production Bundle

npm run bundle
Checkout my other login: React Google Login
Checkout keppelen's: React Facebook Login

Follow me on Twitter: @anthonyjgrove

react-instagram-login's People

Contributors

anthonyjgrove avatar nicowenterodt avatar dependabot[bot] avatar fhenri42 avatar jmporchet avatar alexandrtovmach avatar

Stargazers

Precious Kayili avatar

Watchers

Precious Kayili 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.