Skip to content

Latest commit

 

History

History

oembed-adapters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

OEmbed adapters

The OEmbed field type (from @keystonejs/fields) can fetch oEmbed data from a number of providers such as Iframely.

This package contains adapters for different providers.

IframelyOEmbedAdapter

const { Keystone } = require('@keystonejs/keystone');
const { OEmbed } = require('@keystonejs/fields');
const { IframelyOEmbedAdapter } = require('@keystonejs/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