1.3.12 • Published 3 years ago

opengraph-react v1.3.12

Weekly downloads
325
License
ISC
Repository
github
Last release
3 years ago

Opengraph-react

Opengraph react is a set of handy react components for displaying site previews with the information gathered by https://opengraph.io. Check out a live preview at https://dashboard.opengraph.io/debug.

What is Opengraph.io?

OpenGraph.io client library for nodejs. Given a URL, the client will make a HTTP request to OpenGraph.io which will scrape the site for OpenGraph tags. If tags exist the tags will be returned to you.

Often times the appropriate tags will not exist and this is where OpenGraph.io shines. It will infer what the OpenGraph tags probably would be an return them to you as hybridGraph.

The hybridGraph results will always default to any OpenGraph tags that were found on the page. If only some tags were found, or none were, the missing tags will be inferred from the content on the page.

For most uses, the OpenGraph.io API is free. To get a free forever key, signup at OpenGraph.io.

Installation

Simply install using npm:

npm install --save opengraph-react

Usage

<OpengraphReactComponent  
  site={'site that you want to load (url encoding is done for you)'}  
  appId={Your opengraph.io api key goes here}  
  loader={A component to display while results are being fetched}  
  size={'small'}    
/>

Props

nametypedescription
sitestringWebsite that you want to load uri encoding is done for you so no need to encode it
appIdstringYour ApiKey for opengraph.io (you can get one at www.opengraph.io)
loader(optional)componentA component to display while loading (ex a spinner) won't display anything by default
sizeenumEither small or large. Tells it what kind of card to display
onlyFetchbooleanIf this prop is supplied then no card will display, but instead the results from opengraph will be passed as props to the components children
acceptLangstringaccept lang header for request, defaults to "auto"
useProxybooleanTells opengraph whether or not to use a proxy (defaults to false)
forceCacheUpdatebooleanIf this is supplied opengraph will not reply with cached result (defaults to false)
dontUseVideobooleanComponent will default to supplying a video player if it finds one in the results, pass this prop to override that behavior and just display an image like normal
1.3.11

3 years ago

1.3.12

3 years ago

1.3.10

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.8

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago