> ## Documentation Index
> Fetch the complete documentation index at: https://finance.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Users

> Manage user accounts, profiles, and settings with the JavaScript SDK

## Overview

The Users API allows you to create users, retrieve and update profiles, manage email addresses, and configure trading passwords.

## Class Reference

```javascript theme={null}
import { AriesClient } from '@aries-exchange/sdk';

const client = new AriesClient({
  clientId: 'your_client_id',
  clientSecret: 'your_client_secret'
});
```

## Methods

### createUser()

Create a new user account.

```javascript theme={null}
const user = await client.users.createUser({
  email: 'user@example.com',
  password: 'SecurePass123!',
  firstName: 'John',
  lastName: 'Doe'
});
```

**Returns:** `Promise<User>`

### updateCurrentUser()

Update user profile information.

```javascript theme={null}
const updated = await client.users.updateCurrentUser({
  firstName: 'Jane',
  phone: '+1234567890'
});
```

**Returns:** `Promise<User>`

### getUserAccounts()

Get all trading accounts owned by user.

```javascript theme={null}
const accounts = await client.users.getUserAccounts();
accounts.forEach(account => {
  console.log(`Account: ${account.id} - ${account.accountType}`);
});
```

**Returns:** `Promise<Account[]>`

### getUserProfile()

Get complete user profile.

```javascript theme={null}
const profile = await client.users.getUserProfile();
```

**Returns:** `Promise<Profile>` with personal details

### changeEmail()

Update account email address.

```javascript theme={null}
const result = await client.users.changeEmail('newemail@example.com');
```

**Returns:** `Promise<void>` - Success confirmation

### setTradingPassword()

Configure password for sensitive operations.

```javascript theme={null}
await client.users.setTradingPassword('TradingPass456!');
```

**Returns:** `Promise<void>` - Success confirmation

## TypeScript Types

```typescript theme={null}
interface User {
  id: string;
  email: string;
  firstName: string;
  lastName: string;
  createdAt: Date;
}

interface Account {
  id: string;
  accountType: string;
  status: string;
}
```

## Examples

### User Registration Flow

```javascript theme={null}
// Create new user
const user = await client.users.createUser({
  email: 'trader@example.com',
  password: 'SecurePass123!',
  firstName: 'Alex',
  lastName: 'Smith'
});

// Set trading password
await client.users.setTradingPassword('TradingPass456!');

// Get user accounts
const accounts = await client.users.getUserAccounts();
console.log(`Accounts created: ${accounts.length}`);
```

### Update User Profile

```javascript theme={null}
const profile = await client.users.getUserProfile();
console.log(`Current email: ${profile.email}`);

// Update profile
const updated = await client.users.updateCurrentUser({
  phone: '+1234567890',
  address: '123 Main St'
});
console.log('Profile updated');
```

## Related APIs

* [Accounts](/sdks/javascript/accounts) - Manage trading accounts
* [Authentication](/sdks/javascript/authentication) - OAuth2 authentication
