OEmbed adapters
The OEmbed
field type (from @koikorn/fields
) can fetch oEmbed data
from a number of providers such as Iframely.
This package contains adapters for different providers.
IframelyOEmbedAdapter
const { Keystone } = require('@koikorn/keystone');
const { OEmbed } = require('@koikorn/fields');
const { IframelyOEmbedAdapter } = require('@koikorn/oembed-adapters');
const keystone = new Keystone(/* ... */);
const iframelyAdapter = new IframelyOEmbedAdapter({
apiKey: '...', // Get one from https://iframely.com
});
keystone.createList('User', {
fields: {
portfolio: {
type: OEmbed,
adapter: iframelyAdapter,
},
},
});
The request to Iframely will include the following parameters:
iframe=1
omit_script=1