# login

**.login(username, password)**

Generate a session ID for an account

| Parameter | Type   | Required | Description                                    |
| --------- | ------ | -------- | ---------------------------------------------- |
| username  | string | true     | The username of the account you want to access |
| password  | string | true     | The password of the account you want to access |

**Example:**

```javascript
// Dependencies
const CubedCraft = require('cubed-api');

// Account Details
const username = 'ACCOUNT_USERNAME';
const password = 'ACCOUNT_PASSWORD';

// Defining The Session ID Variable
var sessionID;

// Logging Into The Account
CubedCraft.login(username, password).then(ses => sessionID = ses);
```

{% hint style="info" %}
Read the guide on session IDs: <https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/sessions>
{% endhint %}
