node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

oembed-any

oembed-any

Simple oembed client that works with any url with a published json+oembed link.

If you are displaying html, you probably want to restrict urls to a set of trusted domains to prevent XSS attacks.

API

var oembed = require('oembed-any');

oembed(url): Promise<any>

Return a promise for the oembed data for url.

Example:

oembed('https://www.youtube.com/watch?v=J---aiyznGQ')
.then(res => {
    console.log(res.html);
});