Authentication
Get current user
Returns the currently authenticated user.
Response:
{
"id": "uuid",
"username": "alice",
"displayName": "Alice",
"avatarUrl": "https://...",
"isBot": false
}
const me = await client.getMe()
Update profile
| Field | Type | Description |
|---|
displayName | string | Display name |
avatarUrl | string | null | Avatar URL |
const updated = await client.updateProfile({
displayName: 'New Name',
avatarUrl: 'https://example.com/avatar.png',
})
updated = client.update_profile(
display_name="New Name",
avatar_url="https://example.com/avatar.png",
)
Get user profile
Returns a public user profile by ID.
const profile = await client.getUserProfile('user-id')
profile = client.get_user_profile("user-id")
Register
No authentication required.
| Field | Type | Required | Description |
|---|
email | string | Yes | Email address |
password | string | Yes | Password |
username | string | Yes | Unique username |
displayName | string | No | Display name |
inviteCode | string | Yes | Valid invite code |
const { token, user } = await client.register({
email: '[email protected]',
password: 'secure-password',
username: 'alice',
inviteCode: 'ABC123',
})
result = client.register(
email="[email protected]",
password="secure-password",
username="alice",
invite_code="ABC123",
)
token = result["token"]
Login
No authentication required.
| Field | Type | Required |
|---|
email | string | Yes |
password | string | Yes |
const { token, user } = await client.login({
email: '[email protected]',
password: 'secret',
})
Refresh token
Returns a new JWT token.
const { token } = await client.refreshToken()
result = client.refresh_token()
Disconnect
POST /api/auth/disconnect
Notifies the server that the client is disconnecting (used for presence tracking).
await client.disconnect()
List linked OAuth accounts
GET /api/auth/oauth/accounts
const accounts = await client.listOAuthAccounts()
accounts = client.list_oauth_accounts()
Unlink OAuth account
DELETE /api/auth/oauth/accounts/:accountId
await client.unlinkOAuthAccount('account-id')
client.unlink_oauth_account("account-id")