Login & Authentication for the SDK
Learn how to check for and login to VIVERSE services to access user information including their preferred avatars
Last updated
Was this helpful?
Learn how to check for and login to VIVERSE services to access user information including their preferred avatars
Last updated
Was this helpful?
This guide is designed to help creators integrate VIVERSE SDKs when uploading WebGL content from engines like Unity, three.js or Wonderland Engine to VIVERSE Studio.
BEFORE GETTING STARTED:
An App ID needs to be created, either through the CLI or the VIVERSE Studio workflow. for this information.
The VIVERSE SDK is hosted at this URL and must be integrated into your JavaScript/WebGL project and target engine:
User login is required to check for user information like name, profile picture URL, and .vrm avatar URL.
Before any authentication, initialize the SDK client in your application:
Once the client is initialized, await its checkAuth()
function to check for valid user credentials:
If the user is logged in, you'll get their authentication information in an object structured like so:
If the user is not logged in, the result will come back undefined
.
If login is required for your experience, an automated login and single sign-on (SSO) workflow is available. To request it, this method can be called, which will forward the user through this login flow within the iframe:
Step 4: Handle Post-Login State on Page Load
You can wrap your logic in an arrow function callback on the window's load
event to handle the automatic login flow.
If result
has valid authorization credentials, you can then utilize features like the , Leaderboard SDK and Matchmaking SDK.