# 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.&#x20;

You can check [here](/publisher-flow/sdk-integration/phaser-3/phaser-quick-start.md#get-your-credentials) 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`**](#user-content-fn-1)[^1]

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.

```typescript
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.

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

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

const main = async () => {
  const loginResponse = await reneSdk.login('<EMAIL OF THE USER>', '<PASSWORD>');
  console.log(loginResponse);
}

main()
```

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reneverse.io/publisher-flow/sdk-integration/phaser-3/api-reference/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
