Userbase

Docs : SDK : init

init needs to be the very first thing you call in your web app. It initializes the SDK with your App ID, and it also handles automatic logins when users return to your web app with an active session.

    
      userbase.init({
        appId: 'YOUR_APP_ID'
      }).then((session) => {
        // SDK initialized successfully
        
        if (session.user) {
          // there is a valid active session
          console.log(session.user.username)
        }
      }).catch((e) => console.error(e))
    
  

Parameters

Result

Advanced

Errors