Light Logo
JavaScript SDK (v0.34.0)Reference

AuthenticatedUser

Resource for operations related to the authenticated user.

Class: AuthenticatedUser

Resource for operations related to the authenticated user.

Extends

Constructors

Constructor

new AuthenticatedUser(api): AuthenticatedUser

Create a new resource.

Parameters

api

API

API client instance used to communicate with WriftAI's API.

Returns

AuthenticatedUser

Inherited from

Resource.constructor

Methods

get()

get(signal?): Promise<UserWithDetails>

Get the authenticated user.

Parameters

signal?

AbortSignal

Optional AbortSignal to cancel the request.

Returns

Promise<UserWithDetails>

The user object.


models()

models(options?, signal?): Promise<PaginatedResponse<Model>>

List models of the authenticated user.

Parameters

options?

PaginationOptions

Optional settings to control pagination behavior.

signal?

AbortSignal

Optional AbortSignal to cancel the request.

Returns

Promise<PaginatedResponse<Model>>

A paginated response containing models and navigation metadata.


update()

update(params, signal?): Promise<UserWithDetails>

Update the authenticated user.

Parameters

params

UpdateUserParams

The fields to update.

signal?

AbortSignal

Optional AbortSignal to cancel the request.

Returns

Promise<UserWithDetails>

The updated user object.