My Account component

The My Account component allows your users to manage their account inside your website in a seamless fashion. Your users can add, edit, and remove their credit cards, open inquiries, manage their subscription, and perform other various account-related functions without leaving your website.

Initialization

Enabling the My Account component is as easy as dropping in a few lines of javascript.

// Get the tp object
tp = window["tp"] || [];
tp.push(["init", function() {
    tp.myaccount.show({
        displayMode: "inline",
        containerSelector: "#my-account"
    });
}]);

Login Required

To view their account, a user needs to be logged in. If the user is not logged in, we will fire the loginRequired callback. You can use this callback to redirect the user to your own custom login/registration page, or initialize your login/registration modal.

tp.push(["init", function() {
    tp.myaccount.show({
        displayMode: "inline",
        containerSelector: "#my-account",
        loginRequired: function() {
            // this is a reference implementation only
            // your own custom login/registration implementation would
            // need to return the tinypass-compatible userRef inside the callback
            mysite.showLoginRegistration(function(tinypassUserRef) {
                tp.push(["setUserRef", tinypassUserRef]);
                tp.myaccount.show({
                    displayMode: "inline",
                    containerSelector: "#my-account"
                });
            });
        }
    });
}]);

Janrain Integration

If you are using janrain, there is no additional configuration necessary. If the user is not logged in, we will initialize the janrain loginRequiredScreen that you have configured. Be sure to read more about our janrain integration here.