Embedo Versions Save

Embeds third party content to DOM with perks 🧙‍♀️ (7kb gzip / standalone)

v1.14.0

3 years ago
  • Fixed support for new oEmbed endpoints recently released by Facebook's Graph API
  • To embed facebook or instagram posts, it is required to set access_token property globally or in single instance. This will automatically injected to all embed URLs called with the embedo's instance. No breaking changes.
// facebook initialize options
new Embedo({
  facebook: {
    appId: {your-app-id},
    access_token: {your-app-id|your-client-token}
  }
});

// instagram initialize options
new Embedo({
  instagram: {
    access_token: {your-app-id|your-client-token}
  }
});

PR: https://github.com/shobhitsharma/embedo/pull/26 / bundle-size: 6.9kb / demo: codepen

v1.13.0

4 years ago

Overriding SDK

// Custom SDK Format
new Embedo({
  [source: string (facebook/twitter/...)]: {
    sdk: string
  }
})

// Example for override facebook SDK
new Embedo({
  facebook: {
   sdk: "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"
  }
})

Ref: PR #19 and #20. Also, see options for more details.

v1.12.0

5 years ago
  • update Added Embedo.plugins([ ... plugins ]) to initialize multiple plugins during init for es6 or AMD modules.
import Embedo from 'embedo'
import withEmbedoReddit from 'embedo/plugins/reddit'
import withEmbedoGmaps from 'embedo/plugins/gmaps'
import withEmbedoFlickr from 'embedo/plugins/flickr'

// Then, load plugins
Embedo.plugins([ withEmbedoGmaps, withEmbedoReddit, withEmbedoFlickr ])

// OR works as HOC
withEmbedoReddit(Embedo)

// Then init Embedo instance
Embedo.init({ ..., reddit: true, googlemaps: { ... } })

Try it on codesandbox demo here.

  • patch Fixed instagram embed by adding embedding as iframe as fallback. Due to recent changes with instagram API, they broke their own embed system, but if you add suffix /embed after post/photo URL, it can embed as iframe, see example here.

  • Added Flickr plugin

v1.10.2

5 years ago
  • To embed instagram as iframe alternative, don't use jsonp as boolean, but use undefined or null instead. Apart, resizing iframe itself is not feasible to detect autoheight. I suggest to use iframe-resizer if you need to have auto-detected heights of embed element. Once issue with instagram is resolved, pass jsonp: true|false with load options based on your case.

v1.9.0

5 years ago
  • update Removed googlemaps from core and move to plugins as an add-on on top of embedo class instance in next release.
  • fix Fixed error handling during jsonp fetch

v1.10.0

5 years ago
  • feature Added Domify: .domify() New method that embeds the content to dom with options set using html elements, see usecase here.
  • feature Added Plugins: Integrated extensions that re-uses embedo base class to build plugins based on external sources, see an example here with react.
  • new Added plugins for Google Maps and Reddit, see here.
  • update Disintegration google maps source from core to plugins. You only need to import the plugin in order to make it backward compatible by either loading gmaps script in dom or importing through module and passing Embedo instance to it, as shown here.
  • update Code refactoring and cleanup.

v1.8.0

5 years ago

v1.7.5

5 years ago
  • Fixed issue with instagram embeding. Due to recent security changes in instagram's origin policy, there was an issue with CORB request. It's now handled by using direct XMLHttpRequest method instead of jsonp call.
  • However, a boolean option as jsonp can be set along with instagram options to fallback to old behaviour, in case if instagram changes policy in future again.

v1.7.4

5 years ago
  • fix Fixed Pinterest error handler with setInterval adding unnecessary microtasks which threw error even during success.
  • other Refactoring of codebase. Bumped default FB sdk version to v3.1.

v1.7.3

6 years ago
  • fix Deprecated window.postMessage handler to resolve circular JSON issue caused by async calls in chain.