npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@salvagr/react-instagram-data

v2.0.2

Published

Easy way to get a beautiful media grid from any business instagram account.

Downloads

411

Readme

React Instagram Data

Easy way to get a beautiful media grid from any business instagram account.

IMPORTANT! If you wanna use this package, you need to have a App in developers.facebook.com with a instagram graph api connected.

Installation

npm install @salvagr/react-instagram-data
# OR
yarn add @salvagr/react-instagram-data

I use the env file to setup the functionality. Please follow the next step depending on your project. Right now, the vars are public for client, I'm working for making these private.

NEXT.JS

# .env file
NEXT_PUBLIC_IG_ACCESS_TOKEN=...
NEXT_PUBLIC_IG_BUSINESS_ID=...

REACT APP

# .env file
REACT_APP_IG_ACCESS_TOKEN=...
REACT_APP_IG_BUSINESS_ID=...

Example usage

import { Instagram } from '@salvagr/react-instagram-data';

const App = () => {
  return (
    <div>
      <Instagram
        username="instagram"
      />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Change the style

You can change the style and add your own. Each component has a name assigned (next table), you can use the React style to change the css of the component.

Key|Default ---|--- profileContainer|backgroundColor: #F5F5F5display: 'flex'alignItems: 'center'maxWidth: '300px'justifyContent: 'space-evenly'padding: '10px'borderRadius: '20px'fontFamily: '#Poppins' profileImage|borderRadius: '100vh'<br>maxWidth: '80px' profileDataContainer|h2 : {<br>&ensp;margin: '0.5rem 0',<br>&ensp;fontSize: '21px'<br>} profileFollowsContainer|p : {<br>&ensp;margin: '0.4rem 0',<br>&ensp;fontSize: '14px'<br>&ensp;} mediaContainer|backgroundColor: #F5F5F5<br>display: 'flex'<br>gap: '1rem'<br>justifyContent: 'center'<br>alignItems: 'flex-start'<br>marginItems: '1rem'<br>padding: '1rem'<br>borderRadius: '20px'<br>flexWrap: 'wrap' mediaBox|backgroundColor: #fff<br>width: '300px'<br>borderRadius: '20px'<br>display: 'flex'<br>flexDirection: 'column'<br>flexWrap: 'wrap'<br>position: 'relative'<br>zIndex: '1'<br>a: {<br>&ensp;textDecoration: 'none',<br>&ensp;color: '#121212'<br>}<br>image: {<br>&ensp;maxWidth: '100%',<br>&ensp;borderRadius: '20px',<br>&ensp;display: 'block'<br>} overlay|backgroundColor: rgba(0,0,0,0.0)`transform: 'scale(0)'transition: 'background .25s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s linear .25s'position: 'absolute'width: '100%'height: '100%'top: 0borderRadius: '20px'fontFamily: 'Poppins'content: { color: 'white', position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%), infoRows: { display: 'flex', alignItems: 'center', gap: '0.3rem' }}

import { Instagram } from '@salvagr/react-instagram-data';

const App = () => {
  return (
    <div>
      <Instagram
        username="instagram"
        style={{
          profileContainer: {
            backgroundColor: '#FFAAAA'
          }
        }}
      />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Limit

You can limit the post results.

<Instagram
  limit={8}
  username="instagram"
/>