We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to display the Registration Screen instead of the Login Screen?

If you are using Javascript to show a login or registration modal, and you would like to first show the registration screen instead of the login screen, you can use the following code:

tp = window.tp || [];
tp.push(["init", function() {
 tp.pianoId.show({
 screen: 'register',
 loggedIn: function(data) {
 console.log('user ', data.user, ' logged in with token', data.token);
 },
 loggedOut: function() {
 console.log('user logged out');
 }
 });
}]);

If you'd like to show the login screen, you can use the following code:

tp = window.tp || [];
tp.push(["init", function() {
 tp.pianoId.show({
 screen: 'login',
 loggedIn: function(data) {
 console.log('user ', data.user, ' logged in with token', data.token);
 },
 loggedOut: function() {
 console.log('user logged out');
 }
 });
}]);

Last updated: