Authentication

Get current user

GET /api/auth/me

Returns the currently authenticated user.

Response:

{
  "id": "uuid",
  "username": "alice",
  "displayName": "Alice",
  "avatarUrl": "https://...",
  "isBot": false
}
const me = await client.getMe()
me = client.get_me()

Update profile

PATCH /api/auth/me
FieldTypeDescription
displayNamestringDisplay name
avatarUrlstring | nullAvatar 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

GET /api/auth/users/:id

Returns a public user profile by ID.

const profile = await client.getUserProfile('user-id')
profile = client.get_user_profile("user-id")

Register

POST /api/auth/register

No authentication required.

FieldTypeRequiredDescription
emailstringYesEmail address
passwordstringYesPassword
usernamestringYesUnique username
displayNamestringNoDisplay name
inviteCodestringYesValid 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

POST /api/auth/login

No authentication required.

FieldTypeRequired
emailstringYes
passwordstringYes
const { token, user } = await client.login({
  email: '[email protected]',
  password: 'secret',
})
result = client.login(email="[email protected]", password="secret")

Refresh token

POST /api/auth/refresh

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()
client.disconnect()

List linked OAuth accounts

GET /api/auth/oauth/accounts
const accounts = await client.listOAuthAccounts()
accounts = client.list_oauth_accounts()

DELETE /api/auth/oauth/accounts/:accountId
await client.unlinkOAuthAccount('account-id')
client.unlink_oauth_account("account-id")