Skip to main content

Class: AppsApi

Defined in: packages/sdk/src/api/apps.ts:10

Public API surface — excludes admin/superuser types and classes.

Used by @gravity-rail/sdk. Instead of re-exporting through the types.ts barrel (which includes admin types via export *), this file exports from each type sub-module individually. Admin-containing modules use selective exports.

Admin types excluded: AdminAccount, AdminAccountFormData, AdminAccountMembership, AdminAccountOrgMembership, AdminOrganization, AdminWorkspaceMemberFormData, AdminInboxMappingRequest, AdminWorkspace, AdminWorkspaceFormData, AdminUpdateProductRequest

Extends

Constructors

Constructor

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

Defined in: packages/sdk/src/api/base.ts:184

Parameters

apiKey

string | undefined

baseUrl

string

customFetch?

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

Returns

AppsApi

Inherited from

BaseApiClient.constructor

Methods

createApp()

createApp(request): Promise<App>

Defined in: packages/sdk/src/api/apps.ts:32

Create a new app

Parameters

request

CreateAppRequest

Returns

Promise<App>


deleteApp()

deleteApp(appId): Promise<{ message: string; }>

Defined in: packages/sdk/src/api/apps.ts:66

Delete an app

Parameters

appId

string

Returns

Promise<{ message: string; }>


getActingMember()

getActingMember(): string | undefined

Defined in: packages/sdk/src/api/base.ts:237

Get the current acting member UUID.

Returns

string | undefined

Inherited from

BaseApiClient.getActingMember


getApp()

getApp(appId): Promise<App>

Defined in: packages/sdk/src/api/apps.ts:42

Get details of a specific app

Parameters

appId

string

Returns

Promise<App>


getAppByClientId()

getAppByClientId(clientId): Promise<App>

Defined in: packages/sdk/src/api/apps.ts:49

Get app by client ID (for OAuth flows)

Parameters

clientId

string

Returns

Promise<App>


listApps()

listApps(params?): Promise<AppListResponse>

Defined in: packages/sdk/src/api/apps.ts:14

List apps - either public apps, account's apps, or all apps visible to a workspace

Parameters

params?
builderId?

number

public?

boolean

workspaceUuid?

string

Returns

Promise<AppListResponse>


regenerateClientSecret()

regenerateClientSecret(appId): Promise<AppCredentialResponse>

Defined in: packages/sdk/src/api/apps.ts:75

Regenerate client secret for an app

Parameters

appId

string

Returns

Promise<AppCredentialResponse>


setActingMember()

setActingMember(memberUuid): void

Defined in: packages/sdk/src/api/base.ts:230

Set the acting member UUID for member identity switching. When set, all API requests will include the X-Acting-Member header. The backend will validate that the authenticated account owns this member and use it as the effective identity for the request.

Parameters

memberUuid

string | undefined

Returns

void

Inherited from

BaseApiClient.setActingMember


setEnhancedAuthHandler()

setEnhancedAuthHandler(handler): void

Defined in: packages/sdk/src/api/base.ts:204

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

Defined in: packages/sdk/src/api/base.ts:213

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

Defined in: packages/sdk/src/api/base.ts:251

Set the opaque org session credential for cross-domain requests. 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

Defined in: packages/sdk/src/api/base.ts:260

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

Defined in: packages/sdk/src/api/base.ts:220

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

Parameters

newApiKey

string

Returns

void

Inherited from

BaseApiClient.updateApiKey


updateApp()

updateApp(appId, request): Promise<App>

Defined in: packages/sdk/src/api/apps.ts:56

Update an app

Parameters

appId

string

request

UpdateAppRequest

Returns

Promise<App>