PyramidEmbedClient

The main embed client. This object manages the life cycle of the embed engine on the host page. Through the client, developers can instantiate three types of embed capabilities:

  • embedded content: used for directly embedding Discover visuals or Present dashboards
  • embedded hub: used for embedding the Hub interface, to allow users to self-build collages of content
  • embedded search: used for embedding the NLQ based search experience, the results, and an optional chatbot

Constructors

PyramidEmbedClient(host:string): pyramidEmbedClient

or

PyramidEmbedClient(host:string, username?:string, password?:string, customData?:string): PyramidEmbedClient
  • Use this to create an instance of the embed client object. The embed object exposes key methods and functions for embedding content, search and the hub.
  • Host is the URL of the Pyramid instance. Required.
  • Optionally injecting the username and password values can also authenticate the user at the same time. .
  • The optional customdata argument allows developers to inject custom data elements into the user's session.
  • The constructor cannot be called until the library has been loaded

Once instantiated, use the methods and properties below to create and manipulate embedded content or the embedded hub.

Methods

General Methods

  • init - initialize the embed client
  • login - authenticate the user (username and password) against the host and automatically set the embed cookie
  • loginWinAuth - authenticate the user with Windows Kerberos tokens against the host and automatically set the embed cookie
  • loginSAMLAuth - authenticate the user with SAML tokens against the host and automatically set the embed cookie
  • loginOpenIdAuth - authenticate the user with OpenID OAuth tokens against the host and automatically set the embed cookie
  • setAuthToken - manually set the authentication token into the embed cookie
  • getAuthToken - get the authentication token from the embed cookie
  • SetAuthFailureCallback - set a functional call back when authentication fails

Key Methods

  • content - embeds content into the target HTML5 container. Returns the embed object. The 'embed' function is an older alias for the 'content' method.
    • quickEmbed - simplified function to embed content together with embed client initialization and login
  • hub - embeds the hub object into the target HTML5 container. Returns the 'Hub' object.
  • search - embeds NLQ search into a target HTML5 container. Returns the Search object.

Properties

  • host - get the host address of the current embed client
  • isClientLoaded - gets the status of the embed client
  • isLoggedIn - gets whether the authentication cookie has been set

Example

The following instantiates a new embed client for the target instance of Pyramid

var client = new PyramidEmbedClient("https://analytics.pyramid.com");