Skip to content

react-tiny-oembed sample plugin, a dirty little hack to get github gist urls running without proxy server

Notifications You must be signed in to change notification settings

muzam1l/oembed-github-gist

Repository files navigation

Github gist sample plugin for react-tiny-oembed without proxy server.

Installation

npm install oembed-github-gist

Usage

import Embed, { defaultProviders } from 'react-tiny-oembed'
import gist from 'oembed-github-gist'

function App() {
...

    <Embed
        url="https://gist.github.com/gfx/7a35efaca5e6b40a8b4f888b7f36a5d1"
        proxy="http://cors-anywhere.herokuapp.com/"
        providers={[...defaultProviders, gist]}
    />
}

Options

Nohing much, but you gotta provide height in Embed options, otherwise it straight out uses maxheight from same options as height, which works for most cases though.

About

This is basically a dirty little hack to get github gist urls running with react-tiny-oembed without need for a oembed wrapper proxy server.

It uses requestInterceptor and responceInterceptor in Provider object to do some hacks so as to convert request and responce into the format Embed component can undestand.

About

react-tiny-oembed sample plugin, a dirty little hack to get github gist urls running without proxy server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published