Skip to content
KeystoneJS LogoKeystoneJSv5

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,
    },
  },
});

NOTE: The request to Iframely will include the following parameters:

  • iframe=1
  • omit_script=1

Have you found a mistake, something that is missing, or could be improved on this page? Please edit the Markdown file on GitHub and submit a PR with your changes.

Edit Page