@koikorn/oembed-adapters

5.1.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @koikorn/oembed-adapters

Weekly Downloads

1

Version

5.1.4

License

MIT

Unpacked Size

21.4 kB

Total Files

11

Last publish

Collaborators

  • lorenhaim