Skip to content

sugarshin/react-instagram-embed

Folders and files

NameName
Last commit message
Last commit date
Jul 10, 2021
Nov 9, 2020
Jul 9, 2021
Jul 10, 2021
Jul 10, 2021
Jul 10, 2021
Jul 9, 2021
Jul 9, 2021
Nov 9, 2020
Jul 9, 2021
Jul 10, 2021
Mar 1, 2018
Jul 9, 2021
Jul 9, 2021
Jul 9, 2021
Jul 9, 2021
Jan 27, 2019
Nov 6, 2020
Jul 9, 2021
Feb 19, 2025
Feb 19, 2025
Feb 5, 2019
Jan 27, 2019
Jan 27, 2019
Jul 10, 2021
Jul 10, 2021
Jul 10, 2021

Repository files navigation

react-instagram-embed

CircleCI npm version License

React embedding Instagram posts component

yarn add react-instagram-embed

# or

npm i react-instagram-embed

Live demo

Usage

import InstagramEmbed from 'react-instagram-embed';

<InstagramEmbed
  url='https://instagr.am/p/Zw9o4/'
  clientAccessToken='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
  • clientAccessToken {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