linxio-js
SDK Reference

Authentication

Login, OTP, token refresh, current user, logout, and session hydration methods.

Use the auth service to create and maintain a Linxio session. Successful login, verifyOtp, and refresh calls update the client instance in memory, so later service calls send the bearer token automatically.

auth.login()

POST

Log in to Linxio

/loginlinxio.auth.login(request)

Authenticates a Linxio user and stores the returned session on the client.

Input

request.email
string
required
Email address for the Linxio API or dashboard user.
request.password
string
required
Password for the user. Load this from a secret store or environment variable.
request.domain
string
optional
Optional tenant or hosted-domain hint. Most API integrations can omit it.

Returns

data.token
string
optional
JWT bearer token used for authenticated API requests.
data.refreshToken
string
optional
Refresh token used by the SDK when a recoverable 401 response is received.
data.expireAt
ISODateString
optional
Token expiry timestamp when supplied by Linxio.
data.otp_required
boolean
optional
True when the account must complete OTP before the session is usable.
error
LinxioError | null
optional
Typed SDK error when login fails.

auth.verifyOtp()

POST

Verify one-time password

/login/otplinxio.auth.verifyOtp(request)

Completes one-time-password verification for accounts where Linxio requires OTP during login.

Input

request.email
string
required
Email address used for the login attempt.
request.code
string
required
One-time password code supplied by Linxio.

Returns

data
LinxioLoginResponse
optional
The same session shape returned by auth.login().
error
LinxioError | null
optional
Typed SDK error when OTP verification fails.

auth.refresh()

POST

Refresh JWT auth token

/token/refreshlinxio.auth.refresh(refreshToken)

Refreshes a JWT manually and updates the client session. Most callers do not need this because the HTTP layer refreshes automatically after a recoverable 401.

Input

refreshToken
string
required
Refresh token returned by login or a previous refresh call.

Returns

data
LinxioSession
optional
Updated in-memory token state containing token, refreshToken, and expireAt when available.
error
LinxioError | null
optional
Typed SDK error when refresh fails.

auth.me()

GET

Get current user

/melinxio.auth.me(fields)

Fetches the current authenticated user. Pass fields when you only need a small subset of the user profile.

Input

fields
string[]
optional
Optional field projection mapped to fields[] query parameters.

Returns

data
LinxioCurrentUser
optional
Current user profile, permissions, team information, and tenant-specific fields returned by Linxio.
error
LinxioError | null
optional
Typed SDK error when the user cannot be loaded.

auth.logout()

POST

Log out current session

/logoutlinxio.auth.logout()

Logs out the current session server-side. The SDK returns a standard result so console scripts can fail cleanly.

Input

none
void
optional
logout() does not take parameters.

Returns

data
void
optional
Undefined when logout succeeds.
error
LinxioError | null
optional
Typed SDK error when logout fails.

Session helpers

Manage client session

linxio.session(); linxio.setSession(session)

session() returns a copy of the current in-memory session. setSession() hydrates or replaces it.

LinxioSession

token
string
optional
JWT bearer token.
refreshToken
string
optional
Refresh token used for automatic token refresh.
expireAt
ISODateString
optional
Token expiry timestamp when supplied by Linxio.

On this page