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

object
optional
Object parameter. Expand to see child parameters.
Show child parameters
string
required
Email address for the Linxio API or dashboard user.
string
required
Password for the user. Load this from a secret store or environment variable.
string
optional
Optional tenant or hosted-domain hint. Most API integrations can omit it.

Returns

object
optional
Object field. Expand to see child fields.
Show child fields
string
optional
JWT bearer token used for authenticated API requests.
string
optional
Refresh token used by the SDK when a recoverable 401 response is received.
ISODateString
optional
Token expiry timestamp when supplied by Linxio.
boolean
optional
True when the account must complete OTP before the session is usable.
optional
Typed SDK error when login fails.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

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

object
optional
Object parameter. Expand to see child parameters.
Show child parameters
string
required
Email address used for the login attempt.
string
required
One-time password code supplied by Linxio.

Returns

The same session shape returned by auth.login().
Show child fields
ISODateString
optional
Token expiry timestamp when supplied.
boolean
optional
Whether the login flow was resolved by identifier.
boolean
optional
Whether OTP verification is required before the session is usable.
string
optional
Refresh token used to renew the session.
LinxioId
optional
Role identifier when supplied.
LinxioTeamType
optional
Team type returned by Linxio.
Possible enum values
admin

Administrative team.

client

Client-account team.

reseller

Reseller-account team.

string
required
JWT bearer token for authenticated requests.
optional
Typed SDK error when OTP verification fails.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

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

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

Returns

optional
Updated in-memory token state containing token, refreshToken, and expireAt when available.
Show child fields
ISODateString
optional
Token expiry timestamp.
string
optional
Refresh token.
string
optional
JWT bearer token.
optional
Typed SDK error when refresh fails.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

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

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

Returns

optional
Current user profile, permissions, team information, and tenant-specific fields returned by Linxio.
Show child fields
string
optional
User date format when supplied.
string
optional
Current user email address.
string
optional
Current user display name.
LinxioId
optional
Current user identifier.
string[]
optional
Permission keys when supplied.
JsonObject
optional
Current team details.
LinxioTeamType
optional
Current team type.
Possible enum values
admin

Administrative team.

client

Client-account team.

reseller

Reseller-account team.

optional
Typed SDK error when the user cannot be loaded.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

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

void
optional
logout() does not take parameters.

Returns

void
optional
Undefined when logout succeeds.
optional
Typed SDK error when logout fails.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

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

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

On this page