@sse-auth/instagram
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

SSE Instagram Login

NPM Downloads NPM Downloads npm version

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

Install

npm install @sse-auth/instagram

How to use

import React from 'react';
import ReactDOM from 'react-dom';
import InstagramLogin from '@sse-auth/instagram';

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

ReactDOM.render(
  <InstagramLogin
    clientId="your id"
    clientSecret="your secret"
    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"
    clientSecret="your_client_secret"
    onSuccess={responseInstagram}
    onFailure={responseInstagram}
  >
    <FontAwesome
      name="instagram"
    />
    <span> Login with Instagram</span>
  </InstagramLogin>

Production Bundle

npm run build

Readme

Keywords

none

Package Sidebar

Install

npm i @sse-auth/instagram

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

22.8 kB

Total Files

13

Last publish

Collaborators

  • sseworld