Login

This script can be called anywhere as you already have the SDK script in your header section.

ParametersDescription
clientId

The 'clientId' is retrieved from the Client Integrations Page of the ConsCent Client Dashboard.

wrappingElementId

'wrappingElementId' is a mandatory string that is the id of an element (e.g. a div with absolute positioning on your website) within which you want the login popup to be embedded.

const csc = window._csc as any;
    csc('conscent-login', {
      debug: true,
      clientId: clientId,
      defaultEmail: defaultEmail || '',
      defaultName: defaultName || '',
      defaultPhone: defaultPhone || '',
      wrappingElementId: 'embed',
      successCallback: async (userDetailsObject: any) => {
        console.log('Success callback received from conscent login', userDetailsObject);
        setUserDetails(userDetailsObject);
        props.setShowLoginModal(false)
      },
      onCrossBtnClickSuccess: async () => {
        console.log('cross btn click successfully');
        props.setShowLoginModal(false)
      },
      unauthorizedCallback: () => {
        console.log('unauthorized callback called');
      },
    });

After integrating the Login script, the Login popup appears on the screen which can be customizable for all the Clients.

Last updated