@aarnila/react-instagram-embeddeprecated

React embedding Instagram posts component

Usage no npm install needed!

<script type="module">
  import aarnilaReactInstagramEmbed from 'https://cdn.skypack.dev/@aarnila/react-instagram-embed';
</script>

README

react-instagram-embed

npm version License

React embedding Instagram posts component

Note: this package is forked from https://github.com/sugarshin/react-instagram-embed

Changed to use the new Instagram Oembed API: https://developers.facebook.com/docs/instagram/oembed

yarn add @aarnila/react-instagram-embed

# or

npm i @aarnila/react-instagram-embed

Repository contains demo app but it would require a valid access token to work.

Usage

import InstagramEmbed from '@aarnila/react-instagram-embed';

<InstagramEmbed
  url='https://instagr.am/p/Zw9o4/'
  accessToken='123|456'
  maxWidth={320}
  hideCaption={false}
  containerTagName='div'
  protocol=''
  injectScript
  onLoading={() => {}}
  onSuccess={() => {}}
  onAfterRender={() => {}}
  onFailure={() => {}}
/>

Access token is combination of App Id and Client Token. See https://developers.facebook.com/docs/instagram/oembed/#access-tokens for more details.

props

  • url {String} Instagram URL. Required
  • accessToken {String} Instagram Client Access Token. Required
  • maxWidth {Number} Max width. Minimum size is 320. Default undefined
  • hideCaption {Boolean} Default false
  • containerTagName {String} Default 'div'
  • protocol {String} Instagram API script protocol. Default '' same as current protocol
    • This property needed if you use device's file system, for example, Electron, Cordova apps
  • injectScript {Boolean} Default true
  • onLoading {Function}
  • onSuccess {Function}
  • onAfterRender {Function}
  • onFailure {Function}

License

MIT

© sugarshin