@pyramid-embed/embed-react
v4.0.1
Published
The wrapper for [@pyramid-embed/embed-js](https://www.npmjs.com/package/@pyramid-embed/embed-js)
Downloads
444
Readme
Pyramid Embed React
The wrapper for @pyramid-embed/embed-js
Installation
yarn add @pyramid-embed/embed-react
npm i @pyramid-embed/embed-react
API documentation
Please check online help for the general documentation.
Usage
import { PyramidEmbedContainer } from '@pyramid-embed/embed-react';
<PyramidEmbedContainer host="http://pyramid:8181" options={embedOptions} />
Properties
host: string
- URL of the Pyramid instanceoptions: EmbedOptions
- embed optionsloginType?: "none" | "forms" | "windows" | "saml"
- authentication typeuserName?: string
- username, used whenloginType="forms"
password?: string
- password, used whenloginType="forms"
authToken?: string
- Pyramid authentication tokensamlToken?: string
- SAML tokenstyle?: object
- apply styles to the container elementclassName?: string
- apply a className to the container elementauthFailureCallback?: Function
- a function that will be called when the embed token has expired
Examples
Basic
The code example uses existing embed auth cookie.
const embedOptions = {
contentId: 'f5366b40-fbc7-4773-8180-7759bb0760df'
}
<PyramidEmbedContainer
host="http://pyramid:8181"
options={embedOptions}
style={{width: 1280, height: 720}}
/>
Windows authentication
const embedOptions = {
contentId: 'f5366b40-fbc7-4773-8180-7759bb0760df'
}
<PyramidEmbedContainer
host="http://pyramid:8181"
options={embedOptions}
loginType="windows"
style={{width: 1280, height: 720}}
/>
Filtering
The code example uses existing embed auth cookie.
import { PyramidEmbedContainer, Filter } from '@pyramid-embed/embed-react';
const filter = Filter.create().addUniqueName('[customer].[country].[France]');
const embedOptions = {
contentId: 'f5366b40-fbc7-4773-8180-7759bb0760df',
filters: filter
}
<PyramidEmbedContainer
host="http://pyramid:8181"
options={embedOptions}
style={{width: 1280, height: 720}}
/>
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.