User
User authentication and profile endpoints.
client.user.me()
Get the current authenticated user's profile.
const = await ..()| Field | Type | Description |
|---|---|---|
userId | string | Unique user identifier |
email | string? | User's email address |
client.user.status()
Check if the current session is authenticated.
const = await ..()
if (.) {
// Show user dashboard
}| Field | Type | Description |
|---|---|---|
authenticated | true | Always true if request succeeds |
userId | string | Authenticated user's ID |
Authentication Errors
Both endpoints require authentication. Without valid credentials, requests throw UNAUTHORIZED.
try {
const user = await client.user.me()
} catch (error) {
// Redirect to login
}How is this guide?