Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Subscriptions
English French
English French

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: