My Account module integration

In this section you can learn how to create a "my-account" section on your website. This allows your subscribers to manage and configure their account directly from your domain.

My Account button

In order to place a My Account button on your website, start with including Cleeng JS library in of your website.

<script type="text/javascript" src="http://cdn.cleeng.com/js-api/3.0/api.js"></script>

Once library is included, you can put My Account button on your website. There are 3 ways of module button implementation:

1. Overlay

<button
    data-cleeng-trigger
    data-action="my-account"
    data-display-type="overlay"
    data-publisher-id="your_publisher_id"
    data-completed-callback="cleengCallbackHandler(result)">
    My Account overflow
</button>


2. Inline

<button
    data-cleeng-trigger
    data-action="my-account"
    data-display-type="inline"
    data-container-id="my-account-container"
    data-publisher-id="your_publisher_id"
    data-completed-callback="cleengCallbackHandler(result)">
    My Account inline
</button>
<div id="my-account-container"></div>


3. Popup

<button
    data-cleeng-trigger
    data-action="my-account"
    data-display-type="popup"
    data-publisher-id="your_publisher_id"
    data-completed-callback="cleengCallbackHandler(result)">
    My Account popup
</button>


Remember to switch "your_publisher_id" into your real publisher id, which can be found in api-keys section


My Account JS

In order to attach My Account trigger to any other DOM element or simply run it once page is loaded, use JS code listed below.

Example of overlay code:

<script>
    CleengApi.myAccount({
       displayType: "overlay",
       publisherId: "your_publisher_id",
       completed: function (result) {
           console.log(result);
       }
    });
</script>

Inline:

<script>
    CleengApi.myAccount({
       displayType: "inline",
       containerId: "my-account-container",
       publisherId: "your_publisher_id",
       completed: function (result) {
           console.log(result);
       }
    });
</script>
<div id="my-account-container"></div>


Styling

It takes over the general styling and branding as set in your Cleeng Dashboard.


My Account module + SSO integration

To display My Account module properly, active user session on cleeng.com is required. As SSO authentication doesn't create such session, Cleeng provides an special method which generates an unique url of My Account module.

generateMyAccountUrl documentation

Such url can be placed inside of the iframe:

<iframe src="/generated_url" width="800px" height="600px" frameborder="0"></iframe>

Note: method can be used only by Enterprise accounts with enabled SSO API.


Deeper integration

If you prefer, you can also create a deeper integration directly in your website and use our server-side API. This gives you full control of the front-end. The following APIs will allow you to replicate most of the ‘my account’ features as given in the embed. Though for security reasons passwords and payment details cannot be touched.



Back to Embed codes