Pyramid Embed
The main embed client. This object manages the life cycle of the embed content on the host page.
Installation
yarn add @pyramid-embed/embed-js
npm i @pyramid-embed/embed-js
API documentation
Please check online help for the general documentation.
Usage
import { PyramidEmbedClient } from '@pyramid-embed/embed-js';
const api = new PyramidEmbedClient('http://pyramid:8181');
Examples
Basic
The code example uses existing embed auth cookie.
import { PyramidEmbedClient } from '@pyramid-embed/embed-js';
const api = new PyramidEmbedClient('http://pyramid:8181');
const embedOptions = {
contentId: 'f5366b40-fbc7-4773-8180-7759bb0760df'
}
const el = document.getElementById('embed-container');
api.embed(el, embedOptions);
<div id="embed-container" style="width: 1280px; height: 720px;"></div>
Filtering
The code example uses existing embed auth cookie.
import { PyramidEmbedClient, Filter } from '@pyramid-embed/embed-js';
const api = new PyramidEmbedClient('http://pyramid:8181');
const filter = Filter.create().addUniqueName('[customer].[country].[France]');
const embedOptions = {
contentId: 'f5366b40-fbc7-4773-8180-7759bb0760df',
filters: filter
}
const el = document.getElementById('embed-container');
api.embed(el, embedOptions);
Further help
For more help on embedding with Pyramid, especially instructions on authentication, scenarios and use of REST APIs together with embedding, please see online help.