Skip to main content
MindTouch Success Center

Sign-in Touchpoint Events

Applies to:
MindTouch (current)
Role required:
Admin

Events

mindtouch-web-widget:login:ready

Fired when the login widget is created. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
 document.addEventListener('mindtouch-web-widget:login:ready', ({ data }) => {
    const embedId = data.embedId;
});

mindtouch-web-widget:login:loaded

Fired when the login widget is loaded. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
  • user <Object> - An object containing information about the request user. This will contain information about the anonymous user if the user is not signed in
  • widget <Object> - The object interface to the widget that contains the properties and/or functions listed below
 document.addEventListener('mindtouch-web-widget:login:loaded', ({ data }) => {
    const embedId = data.embedId;
    const user = data.user;
    const widget = data.widget;
});

mindtouch-web-widget:login:auth-changed

Fired when the login widget detects that the request user's authentication state has changed. The event data contains the following parameters:

  • embedId - The ID of the widget that uniquely identifies it.
  • user - An object containing information about the request user. This will contain information about the anonymous user if the user is not signed in.
document.addEventListener('mindtouch-web-widget:login:auth-changed', ({ data }) => {
    const embedId = data.embedId;
    const user = data.user;
});

Properties

authProviderId <String>

  • Gets the authentication provider id
  • Sets the authentication provider id and updates the sign-in link href. Set as a JavaScript object property or as adata-auth-provider-iddata attribute on the mindtouch/embed script HTML tag.
document.addEventListener('mindtouch-web-widget:login:loaded', ({ data }) => {
    const widget = data.widget;
    
    // use the mindtouch site auth provider with id
    widget.authProviderId = '{example-auth-provider-id}';
    
    // use the default mindtouch site auth provider with "default"
    widget.authProviderId = 'default';
    
    // or null...
    widget.authProviderId = null;
    
    // get the authentication provider id
    const foo = widget.authProviderId;
});
<script async="async" src="https://success.mindtouch.com/@embed/{guid}.js"></script>
<script type="mindtouch/embed" id="mindtouch-embed-{guid}" data-auth-provider-id="{example-auth-provider-id}"></script>

silentLoginExperienceEnabled <Boolean>

  • Gets silent authentication enabled or disabled
  • Enables or disables silent authentication
document.addEventListener('mindtouch-web-widget:login:loaded', ({ data }) => {
    const widget = data.widget;
    const isSilentAuthenticationEnabled = widget.silentLoginExperienceEnabled;
    
    // disable silent authentication
    widget.silentLoginExperienceEnabled = false;   
 
    // enable silent authentication
    widget.silentLoginExperienceEnabled = true;
});
<script async="async" src="https://success.mindtouch.com/@embed/{guid}.js"></script>
<script type="mindtouch/embed" id="mindtouch-embed-{guid}" data-silent-login-experience-enabled="{boolean}"></script>
  • Was this article helpful?