Authentication

There two levels of authentication

Minimum Level

This authentication is absolutely always required, this is basically your Api Key and Private Key. This always needs to be part your requests.

You can check here how to generate it.

All the calls that tagged as public, are not essentially public but are callable using this minimum level of auth, basically for all requests private or public, you need the minimum level of auth.

User Level

This is a complimentary auth layer on top of minimum level of auth, this auth is as the name suggests a user based auth, this is required when calling an endpoint which is tagged as private.

To generate user level auth, there are two ways.

Password Less Auth

PUBLIC

In this authentication scheme, the user does not have provide his/her password directly through the SDK, it's barrier free login, where SDK triggers a notification on Reneverse app for the user to accept the connection, and once they press confirm in the app, that information is relayed back to the SDK and it's then from that point onwards authenticated with user level auth as well.

import { ReneSDK } from '@reneverse/game-sdk';

const reneSdk = new ReneSDK({
  privateKey: '<YOUR PRIVATE KEY>',
  apiKey: '<YOUR API KEY>'
});

const main = async () => {
  /**
  * This basically triggers a request for the user in the app 
  * ( app.reneverse.io ) to accept the connect for this game. 
  * This is a passwordless login for the user, where they just put 
  * in there email and once they accept in the app, the requests gets
  * automatically authenticated.
  **/
  const connectResponse = await reneSdk.connect('<EMAIL OF THE USER>');
  
  /**
  * This waits for the user to press the confirm button in the app, and once they
  * press it, this becomes true, ideally you would use this to manage user state
  * during user's first login
  **/
  const isConnected = await connectResponse.game.waitForGameConnect();
  console.log(isConnected);
}

main()

Regular Auth

PUBLIC

This is a regular authentication scheme, where a user enters his password directly in-game and that information is relayed to the Reneverse, which then authenticates it and returns auth information back to the SDK, in a synchronous fashion.

Last updated