Skip to main content

StediApi

@gravity-rail/sdk


@gravity-rail/sdk / StediApi

Class: StediApi

Read-only Stedi practice status; credentials remain server-side.

Extends​

Constructors​

Constructor​

new StediApi(apiKey, baseUrl, customFetch?): StediApi

Parameters​

apiKey​

string | undefined

baseUrl​

string

customFetch?​

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Returns​

StediApi

Inherited from​

BaseApiClient.constructor

Methods​

getStediConnections()​

getStediConnections(wid): Promise<StediConnectionResponse[]>

Parameters​

wid​

string

Returns​

Promise<StediConnectionResponse[]>


getStediConnectionStatus()​

getStediConnectionStatus(wid, connectionUuid): Promise<StediConnectionResponse>

Parameters​

wid​

string

connectionUuid​

string

Returns​

Promise<StediConnectionResponse>


setEnhancedAuthHandler()​

setEnhancedAuthHandler(handler): void

Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth). This handler is called when a 401 response includes WWW-Authenticate header with error="insufficient_user_authentication".

Parameters​

handler​

EnhancedAuthHandler | undefined

Returns​

void

Inherited from​

BaseApiClient.setEnhancedAuthHandler


setOrgAuthHandler()​

setOrgAuthHandler(handler): void

Set the handler for organization authentication requirements. This handler is called when a 401 response includes WWW-Authenticate header with realm="org". The handler should redirect the user to complete org auth.

Parameters​

handler​

OrgAuthHandler | undefined

Returns​

void

Inherited from​

BaseApiClient.setOrgAuthHandler


setOrgSession()​

setOrgSession(session, orgUuid?): void

Set the opaque org session credential a bearer client sends as X-Org-Session. Opaque gr_sess_ values use X-Org-Session. Legacy orgToken JWE values still use X-Org-Token through setOrgToken() during the migration window.

orgUuid is the org that issued the credential; passing it lets the 401 handler detect a stale session when a subsequent request targets a different org and re-fire the org-auth handler instead of silently 401-ing. Callers without that context (legacy / unknown) may omit it.

Parameters​

session​

string | undefined

orgUuid?​

string

Returns​

void

Inherited from​

BaseApiClient.setOrgSession


setOrgToken()​

setOrgToken(token, orgUuid?): void

Parameters​

token​

string | undefined

orgUuid?​

string

Returns​

void

Deprecated​

Legacy compatibility for stateless orgToken JWE credentials. Prefer setOrgSession() for opaque org browser sessions.

Inherited from​

BaseApiClient.setOrgToken


updateApiKey()​

updateApiKey(newApiKey): void

Update the API key (used after successful re-authentication).

Parameters​

newApiKey​

string

Returns​

void

Inherited from​

BaseApiClient.updateApiKey