mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
refs https://github.com/TryGhost/Team/issues/1237 We want to use an API key for OpenSea where possible so that we do not run into rate limit issues.
30 lines
714 B
JavaScript
30 lines
714 B
JavaScript
const config = require('../../../shared/config');
|
|
const externalRequest = require('../../lib/request-external');
|
|
|
|
const OEmbed = require('../../services/oembed');
|
|
const oembed = new OEmbed({config, externalRequest});
|
|
const NFT = require('../../services/nft-oembed');
|
|
const nft = new NFT({
|
|
config: {
|
|
apiKey: config.get('opensea').privateReadOnlyApiKey
|
|
}
|
|
});
|
|
oembed.registerProvider(nft);
|
|
|
|
module.exports = {
|
|
docName: 'oembed',
|
|
|
|
read: {
|
|
permissions: false,
|
|
data: [
|
|
'url',
|
|
'type'
|
|
],
|
|
options: [],
|
|
query({data}) {
|
|
let {url, type} = data;
|
|
|
|
return oembed.fetchOembedDataFromUrl(url, type);
|
|
}
|
|
}
|
|
};
|