Login

Authenticates the end user to perform embedding operations.

login(username?:string, password?:string, customdata?:string): string
  • The login function, like initialize, authenticates the user and stores the result into the embed cookie.
  • The optional customdata argument allows developers to inject custom data elements into the user's session.
  • The function returns the authentication token string.

Example

The following initializes a new embed client for the target instance of Pyramid and authenticates a new user "john" with custom date "USA".

var client = new pyramidEmbedClient("https://analytics.pyramid.com"); client.init(); client.login("john","ab123!", "USA");