0.0.1 • Published 2 years ago

@john-techfox/react-instagram-login v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Instagram Login

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

Install

npm install @nvt-ak/react-instagram-login
yarn add @nvt-ak/react-instagram-login

How to use

With default button

import ReactDOM from 'react-dom';
import { InstagramLogin } from '@nvt-ak/react-instagram-login';

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

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

onSuccess callback

Displaying OAuth using a popup

Note: The redirectUri needs to be the same url as the current url.

Displaying OAuth using a redirection

If you want to use redirection you should change the prop useRedirect to true. 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 namevalue
errorstring
error_reasonstring
error_descriptionstring

Parameters

paramsvaluedefault value
clientIdstringREQUIRED
scopestringuser_profile
onSuccessfunctionREQUIRED
onFailurefunctionREQUIRED
redirectUristring-
buttonTextstringLogin with Instagram
cssClassstring-
tagstringbutton
typestringbutton
implicitAuthbooleanfalse
useRedirectbooleanfalse
widthnumber400
heightnumber800

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

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

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

Dev Server

yarn dev

Run Tests

yarn test

Production Bundle

yarn build

TODO

  • Fix the test cases
  • Add templates for PR and Issues
  • Use Google, Facebook, Linkedin ... in this project

Done

  • Use Hooks
  • Update dependencies
  • Create a babel Conf
  • Use prettier + Husky
  • Improve and refactor the code
heipmsqswsynajvargdelhaspslurlababdepddiffetagflatgloblevnmimeobufonceopenrxjssendspdytr46uuidvarywbufy18nyamlacornasyncbatchbyteschalkcliuiclonecssomdebugexecafastqfreshgrowlis-ipisexejsescjson5memfsp-mapp-tryreactretrysaxesslashtabletslibutilawhichyargsbig.jsbracescookieespreeeventsglobbyhasownignoreis-wsllistr2lodashmerge2mkdirpnanoidnwsapiparse5rimrafsemversockjsterserthunkyunpipeuri-jswrappyacceptsbabylonbonjourcore-jscsstypedeep-isdestroydns-txtenvinfoesprimaesqueryesutilsexpressfind-upflattedgensyncglobalsis-globisarrayjs-yamlkind-ofmethodsmime-dbno-caseonetimep-eventp-limitp-retrypathvalpkg-dirprivaterechoirregexppresolvereusifytapablethroughtsutilstype-isyallistanymatchargparseasynckitaxe-coreboolbasechokidarcss-whatcssstyledeep-eqldir-globdoctrinedomutilsdot-caseee-firstenquirerentitieserror-exescaladefseventshas-ansihas-flaghpack.jsinflightinheritsip-regexis-regexisobjectmake-dirmimic-fnminimistp-locateparseurlpath-keyprogresspunycoderaw-bodyreact-isreaddirpregjsgenstatuseswildcardxmlcharsacorn-jsxcall-bindcallsitescamelcaseclean-csscolorettecommandercommondirdata-urlsdns-equalencodeurlescodegenesrecursefast-difffast-globform-dataforwardedfs-monkeyinterpretinvariantipaddr.jsis-bigintis-dockeris-finiteis-numberis-streamis-stringis-symboljest-diffjs-tokenslru-cacheminimatchneo-asyncnth-checkobject-isos-tmpdirp-finallyp-timeoutpath-typepicomatchrelateurlrenderkidrepeatingstrip-bomtype-festwatchpackword-wrapwrap-ansiacorn-walkagent-baseansi-regexaria-querycamel-casecli-cursorclone-deepcolor-nameconcat-mapcss-selectdecamelizedecimal.jsdeep-equaldns-packetdomhandlerestraversefill-rangeflat-cacheget-streamhttp-proxyiconv-liteis-extglobis-weakreflodash.getlog-updatelower-casemake-errormicromatchmime-typesnegotiatornode-forgeon-headersoptionatoros-homedirparam-caseparse-jsonpath-parsepicocolorsportfinderprelude-lsprop-typesproxy-addrregenerateselfsignedslice-ansisource-mapsprintf-jsstrip-ansitext-tabletrim-righttype-checkwhatwg-urlwide-alignworkerpoolajv-formatsansi-colorsansi-stylesarray-unionbabel-typesbody-parserbuffer-fromcheck-errorclean-stackcompressioncosmiconfigcross-spawndetect-nodeemoji-regexemojis-listes-abstractescape-htmlfs.realpathglob-parentgraceful-fshas-bigintshas-symbolshome-or-tmphtmlparser2http-errorsimurmurhashinternal-ipis-arrayishis-callableis-path-cwdjest-workerlocate-pathlog-symbolsmedia-typerobject-keyson-finishedpascal-casepath-existsquerystringrandombytesregjsparserresolve-cwdsafe-bufferselect-hoseserve-indexsignal-exitstring-argvsymbol-treetype-detectutils-mergew3c-hr-timeyocto-queueajv-keywordsansi-escapesastral-regexbabel-eslintbrowserslistcaniuse-litecli-truncatecompressiblecontent-typecore-js-purecore-util-isdomexceptioneslint-scopeeslint-utilsfinalhandlerhandle-thingimport-freshimport-localis-argumentsis-plain-objloader-utilslodash.mergelodash.unionloose-envifymerge-streamnpm-run-pathpretty-errorrange-parserregexpu-coreresolve-fromrun-parallelsafer-bufferschema-utilsserve-staticside-channelstring-widthtoidentifiertough-cookieuniversalifyyargs-parseracorn-globalsarray-flattenbabel-helpersbabel-runtimecolor-convertdetect-indentdom-convertereventemitter3function-bindget-func-nameget-intrinsichtml-entitieshttp-deceiverhuman-signalsindent-stringinternal-slotjest-get-typejsx-ast-utilslanguage-tagsloader-runnermulticast-dnsnode-releasesobject-assignobject.assignobject.hasownobject.valuesparent-modulepretty-formatrequires-portshallow-cloneshebang-regexarray-includesast-types-flowaxobject-querybabel-messagesbabel-registerbabel-templatebabel-traversebalanced-matchbrowser-stdoutbuffer-indexofcore-js-compatcreate-requiredelayed-streamdiff-sequencesdom-serializerdomelementtypefaye-websocketfind-cache-dirglob-to-regexphttp-parser-jsimport-modulesis-binary-pathis-core-moduleis-date-objectis-path-insidenormalize-pathobject-inspectobject.entriespath-to-regexprestore-cursorsetprototypeofspdy-transportstring_decodersupports-colorto-regex-rangetsconfig-pathsutil-deprecateyargs-unparseraggregate-errorassertion-errorbabel-generatorbrace-expansioncombined-streamdefault-gatewayes-module-lexeres-to-primitivefast-deep-equalget-caller-filehas-tostringtagis-plain-objectlodash.debouncelodash.truncatenatural-comparequeue-microtaskreadable-streamshebang-commandunbox-primitivewebpack-sourceswhatwg-encodingwhatwg-mimetypebabel-code-framecookie-signaturedefine-lazy-propenhanced-resolvefast-levenshteinfile-entry-cachefollow-redirectshttp-proxy-agentis-negative-zerois-number-objectlodash.clonedeeppath-is-absolutev8-compile-cachewebsocket-driverbinary-extensionsdefine-propertieshttps-proxy-agentis-boolean-objectlines-and-columnsmerge-descriptorsrequire-directoryw3c-xmlserializerchrome-trace-eventconvert-source-mapobject.fromentriessource-map-supportto-fast-propertieswebidl-conversionsxml-name-validatoransi-html-communitycontent-dispositiondamerau-levenshteineslint-module-utilseslint-visitor-keysfastest-levenshteinminimalistic-assertregenerator-runtimerequire-from-stringstrip-final-newlinestrip-json-commentsarray.prototype.flatelectron-to-chromiumescape-string-regexphtml-minifier-terserjson-schema-traverseprocess-nextick-argsserialize-javascriptwebsocket-extensionshtml-encoding-snifferhttp-proxy-middlewareregenerator-transformterser-webpack-pluginwhich-boxed-primitivebrowser-process-hrtimeget-symbol-descriptionis-shared-array-bufferregexp.prototype.flagsstring-natural-comparewebpack-dev-middlewarearray.prototype.flatmapis-fullwidth-code-pointprettier-linter-helpersjson-parse-better-errorslanguage-subtag-registrystring.prototype.trimendconfusing-browser-globalseslint-config-airbnb-basefunctional-red-black-treestring.prototype.matchallfast-json-stable-stringifystring.prototype.trimstarteslint-import-resolver-nodemulticast-dns-service-typesconnect-history-api-fallbackbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3json-parse-even-better-errorsregenerate-unicode-propertiessupports-preserve-symlinks-flagbabel-plugin-dynamic-import-nodeis-potential-custom-element-namebabel-plugin-polyfill-regeneratorunicode-match-property-ecmascriptunicode-property-aliases-ecmascriptjson-stable-stringify-without-jsonifyunicode-match-property-value-ecmascriptunicode-canonical-property-names-ecmascript
0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago