Skip to content
KeystoneJS LogoKeystoneJS

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

JS
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

On this page

  • IframelyOEmbedAdapter
Edit on GitHub