Extra Types
AIChatAction
An event that is used to chat with an AI.
Members
messages AIChatMessage[]
The list of messages comprising the conversation so far.
options AIChatOptions
The options for the action.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "ai_chat"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AIChatInterfaceRequest
Defines an interface that represents an AI chat request.
Members
frequencyPenalty? number
The frequency penalty.
Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
maxTokens? number
The maximum number of tokens that should be generated by the model.
messages AIChatMessage[]
The messages that should be sent to the AI.
model string
The model that should be used.
presencePenalty? number
The presence penalty.
Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
stopWords? string[]
The list of stop words that should be used.
If the AI generates a sequence of tokens that match one of the given words, then it will stop generating tokens.
temperature number
The temperature of the request.
topP? number
The nucleus sampling probability.
userId string
The ID of the user that is making the request.
AIChatInterfaceResponse
Defines an interface that represents an AI chat response.
Members
choices AIChatMessage[]
The messages that the AI responded with.
inputTokens? number
The number of input tokens that were used.
outputTokens? number
The number of output tokens that were used.
totalTokens number
The total number of tokens that were used.
AIChatStreamAction
An event that is used to chat with an AI.
Members
messages AIChatMessage[]
The list of messages comprising the conversation so far.
options AIChatOptions
The options for the action.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "ai_chat_stream"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AIChatSubscriptionMetrics
Members
currentPeriodEndMs number
The unix time in miliseconds of the end of the current subscription period.
currentPeriodStartMs number
The unix time in miliseconds of the start of the current subscription period.
ownerId string
recordName? string
stripeAccountId string
The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
stripeAccountStatus StripeAccountStatus
The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
studioId string
subscriptionId string
The ID of the subscription.
subscriptionStatus string
The status of the subscription.
subscriptionType ("user" | "studio")
The type of the subscription.
totalTokensInCurrentPeriod number
The total number of tokens that have been used for the current period.
userId? string
AIController
Defines a class that is able to handle AI requests.
Members
constructor(configuration: AIConfiguration): AIController
The first parameter is a AIConfiguration and
chat(request: AIChatRequest): Promise<AIChatResponse>
The first parameter is a AIChatRequest and
chatStream(request: AIChatRequest): AsyncGenerator
The first parameter is a AIChatRequest and
createOpenAIRealtimeSessionToken(request: AICreateOpenAIRealtimeSessionTokenRequest): Promise<AICreateOpenAIRealtimeSessionTokenResult>
The first parameter is a AICreateOpenAIRealtimeSessionTokenRequest and
generateImage(request: AIGenerateImageRequest): Promise<AIGenerateImageResponse>
The first parameter is a AIGenerateImageRequest and
generateSkybox(request: AIGenerateSkyboxRequest): Promise<AIGenerateSkyboxResponse>
The first parameter is a AIGenerateSkyboxRequest and
getHumeAccessToken(request: AIHumeGetAccessTokenRequest): Promise<AIHumeGetAccessTokenResult>
The first parameter is a AIHumeGetAccessTokenRequest and
getSkybox(request: AIGetSkyboxRequest): Promise<AIGetSkyboxResponse>
The first parameter is a AIGetSkyboxRequest and
listChatModels(request: ListChatModelsRequest): Promise<Result>
The first parameter is a ListChatModelsRequest and
sloydGenerateModel(request: AISloydGenerateModelRequest): Promise<AISloydGenerateModelResponse>
The first parameter is a AISloydGenerateModelRequest and
AIGenerateImageAction
An event that is used to generate an image using AI.
Members
cfgScale? number
How strictly the diffusion process adheres to the prompt text. Higher values keep the image closer to the prompt.
clipGuidancePreset? string
The clip guidance preset.
height? number
The desired height of the image(s) in pixels.
model? string
The model that should be used to generate the image(s).
negativePrompt? string
The description of what the generated image(s) should not look like.
numberOfImages? number
The number of images that should be generated.
options RecordActionOptions
The options for the action.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
prompt string
The description of what the generated image(s) should look like.
sampler? string
The sampler to use for the diffusion process.
seed? number
The random noise seed that should be used.
steps? number
The number of diffusion steps to run.
stylePreset? string
The style preset that should be used to guide the image model torwards a specific style.
taskId (string | number)
The ID of the async task.
type "ai_generate_image"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
width? number
The desired width of the image(s) in pixels.
AIGenerateImageInterfaceRequest
Members
cfgScale? number
How strictly the diffusion process adheres to the prompt text. Higher values keep the image closer to the prompt.
clipGuidancePreset? string
The clip guidance preset.
height? number
The height of the output image(s) in pixels.
model string
The model that should be used to generate the image(s).
negativePrompt? string
The description of what the image should not be.
numberOfImages? number
The number of images that should be generated.
prompt string
The description of the desired image.
sampler? string
The sampler to use for the diffusion process.
seed? number
The random noise seed that should be used.
steps? number
The number of diffusion steps to run.
stylePreset? string
The style preset that should be used to guide the image model torwards a specific style.
userId? string
The ID of the user that is making the request.
width? number
The width of the output image(s) in pixels.
AIGenerateSkyboxInterface
Defines an interface that is able to send and receive AI chat messages.
Members
generateSkybox(request: AIGenerateSkyboxInterfaceRequest): Promise<AIGenerateSkyboxInterfaceResponse>
Sends a generate skybox request to the AI API.
The first parameter is a AIGenerateSkyboxInterfaceRequest and is the request to send.
getSkybox(skyboxId: string): Promise<AIGetSkyboxInterfaceResponse>
Attempts to get the skybox with the given ID.
The first parameter is a string and is the ID of the skybox.
AIHumeGetAccessTokenAction
An event that is used to generate an image using AI.
Members
options RecordActionOptions
The options that the action should use.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
recordName? string
The name of the record that the access token should be retrieved for.
taskId (string | number)
The ID of the async task.
type "ai_hume_get_access_token"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AIImageMetrics
Members
createdAtMs number
The unix time in miliseconds of when the metrics were created.
squarePixels number
The number of square pixels that have been used. This is the number of pixels squared.
studioId? string
The ID of the studio that the metrics are for.
userId? string
The ID of the user that the metrics are for.
AIImageSubscriptionMetrics
Members
currentPeriodEndMs number
The unix time in miliseconds of the end of the current subscription period.
currentPeriodStartMs number
The unix time in miliseconds of the start of the current subscription period.
ownerId string
recordName? string
stripeAccountId string
The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
stripeAccountStatus StripeAccountStatus
The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
studioId string
subscriptionId string
The ID of the subscription.
subscriptionStatus string
The status of the subscription.
subscriptionType ("user" | "studio")
The type of the subscription.
totalSquarePixelsInCurrentPeriod number
The total number of pixels that have been generated for the current period.
userId? string
AIOpenAIRealtimeInterface
Members
createRealtimeSessionToken(request: RealtimeSessionRequest): Promise<CreateRealtimeSessionTokenResult>
Creates a new realtime session.
The first parameter is a RealtimeSessionRequest and is the request to send.
AIOpenAIRealtimeMetrics
Members
createdAtMs number
The unix time in miliseconds of when the metrics were created.
request RealtimeSessionRequest
The request that was used to create the session.
sessionId string
The ID of the session that was created.
studioId? string
The ID of the studio that the metrics are for.
userId? string
The ID of the user that the metrics are for.
AIOpenAIRealtimeSubscriptionMetrics
Members
currentPeriodEndMs number
The unix time in miliseconds of the end of the current subscription period.
currentPeriodStartMs number
The unix time in miliseconds of the start of the current subscription period.
ownerId string
recordName? string
stripeAccountId string
The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
stripeAccountStatus StripeAccountStatus
The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
studioId string
subscriptionId string
The ID of the subscription.
subscriptionStatus string
The status of the subscription.
subscriptionType ("user" | "studio")
The type of the subscription.
totalSessionsInCurrentPeriod number
The total number of realtime sessions that have been created in the period.
userId? string
AISkyboxSubscriptionMetrics
Members
currentPeriodEndMs number
The unix time in miliseconds of the end of the current subscription period.
currentPeriodStartMs number
The unix time in miliseconds of the start of the current subscription period.
ownerId string
recordName? string
stripeAccountId string
The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
stripeAccountStatus StripeAccountStatus
The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
studioId string
subscriptionId string
The ID of the subscription.
subscriptionStatus string
The status of the subscription.
subscriptionType ("user" | "studio")
The type of the subscription.
totalSkyboxesInCurrentPeriod number
The total number of skyboxes that have been generated for the current period.
userId? string
AISloydGenerateModelAction
An event that is used to generate a model using Sloyd AI.
Members
baseModelId? string
The ID of the model that the new model should be based on.
levelOfDetail? number
The level of detail that should be used. Higher values will result in more detailed models. Should be between
0.01and1. Defaults to0.5.options RecordActionOptions
The options that the action should use.
outputMimeType? ("model/gltf+json" | "model/gltf-binary")
The MIME type that should be used for the model. If omitted, then "model/gltf+json" will be used.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
prompt string
The prompt to use for the model.
recordName? string
The name of the record that should be used. If omitted, then the ID of the user will be used.
taskId (string | number)
The ID of the async task.
thumbnail? object
The options for the thumbnail for the model. If omitted, then no thumbnail will be generated.
type "ai_sloyd_generate_model"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AISloydMetrics
Members
baseModelId? string
The ID of the model that the created model is based on.
confidence? number
The confidence of the AI in the created model.
createdAtMs number
The unix time in miliseconds of when the metrics were created.
mimeType string
The MIME type of the model.
modelData string
The data for the model. If the mimeType is "model/gltf+json", then this will be a JSON string. If the mimeType is "model/gltf-binary", then this will be a base64 encoded string.
modelId string
The ID of the model that was created. ("interactionId" in the sloyd interface)
modelsCreated number
The number of models that were created in this metric.
name? string
The name of the model that was created.
studioId? string
The ID of the studio that the metrics are for.
thumbnailBase64? string
The base64 encoded thumbnail of the model.
userId? string
The ID of the user that the metrics are for.
AISloydSubscriptionMetrics
Members
currentPeriodEndMs number
The unix time in miliseconds of the end of the current subscription period.
currentPeriodStartMs number
The unix time in miliseconds of the start of the current subscription period.
ownerId string
recordName? string
stripeAccountId string
The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
stripeAccountStatus StripeAccountStatus
The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.
studioId string
subscriptionId string
The ID of the subscription.
subscriptionStatus string
The status of the subscription.
subscriptionType ("user" | "studio")
The type of the subscription.
totalModelsInCurrentPeriod number
The total number of sloyd.ai items that have been created for the current period.
userId? string
APIPayoutRequest
Members
amount? number
destination? PayoutDestination
APISubscription
Members
creditGrant? (number | "match-invoice")
The number of credits that should be granted to the user/studio upon purchasing (and renewal) of this subscription. Defaults to 0.
defaultSubscription? boolean
Whether this subscription should be the default.
description? string
The description of the subscription. Ignored if a Stripe product is specified.
eligibleProducts? string[]
The list of products that are eligible for this subscription tier.
featureList string[]
The list of features that should be shown for this subscription tier.
id string
The ID of the subscription. Only used for the API.
name? string
The name of the subscription. Ignored if a Stripe product is specified.
product? string
The ID of the product that needs to be purchased for the subscription. If omitted, then this subscription will be shown but not able to be purchased.
purchasable? boolean
Whether the subscription should be offered for purchase. Defaults to true.
studioOnly? boolean
Whether the subscription is only purchasable by studios.
tier? string
The tier that the subscription represents. Defaults to "beta".
userOnly? boolean
Whether the subscription is only purchasable by users.
AccountBalances
Represents the balances of a user/studio/contract's financial accounts.
Members
credits AccountBalance
The credits account balance.
This will be undefined if the user does not have a credits account.
usd AccountBalance
The USD account balance.
This will be undefined if the user does not have a USD account.
AddBotMapLayerAction
Defines an interface for actions that represent asynchronous tasks.
Members
botId string
The ID of the bot that should be drawn on.
overlay object
Layer configuration
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "add_bot_map_layer"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AddDropGridTargetsAction
An event that is used to add grids as possible drop locations for a drag operation.
Members
botId? string
The ID of the bot that, when it is a drop target, the snap points should be enabled. If null, then the targets apply globally during the drag operation.
type "add_drop_grid_targets"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AddStudioMemberRequest
Members
addedDisplayName? string
The display name of the user that should be added to the studio.
addedEmail? string
The email address of the user that should be added to the studio.
addedPhoneNumber? string
The phone number of the user that should be added to the studio.
addedUserId? string
The ID of the user that should be added to the studio.
role StudioAssignmentRole
The role that the added user should have in the studio.
studioId string
The ID of the studio.
userId string
The ID of the user that is currently logged in.
AddUpdatesRequest
Members
branch string
The branch that the updates are for.
initial? boolean
Whether this message should be treated as the first message after a watch_branch event. This flag MUST be included on the first message as large apiary messages may appear out of order.
inst string
The name of the inst.
recordName string
The name of the record that the branch is for. Null if the branch should be public and non-permanent.
timestamps? number[]
The list of timestamps that the updates occurred at.
updates string[]
The updates that should be added.
userId string
The ID of the currently logged in user.
AnimateTagAction
Defines an event that animates a tag on a bot over some time.
Members
botId string
The ID of the bot to animate.
options AnimateTagOptions
The options to use for the animation.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
tag string
The tag to animate.
taskId (string | number)
The ID of the async task.
type "animate_tag"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
ApplyUpdatesToInstAction
Defines an event that applies the given updates to the inst.
Members
type "apply_updates_to_inst"
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
updates InstUpdate[]
The updates that should be applied.
AsyncAction
Defines an interface for actions that represent asynchronous tasks.
Members
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type string
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AsyncErrorAction
Defines an action that supplies an error for an AsyncRequestAction.
Members
error any
The error.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "async_error"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AsyncResultAction
Defines an action that supplies a result for an AsyncRequestAction.
Members
mapBotsInResult? boolean
Whether to map any bots found in the result to their actual bot counterparts. Defaults to false.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
result any
The result value.
taskId (string | number)
The ID of the async task.
type "async_result"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AuthCheckoutSession
Defines an interface that represents a checkout session for a purchasable item.
Members
fulfilledAtMs number
The unix time in miliseconds that the checkout session has been fulfilled at by granting the user access to their items.
For contracts, this means opening the contract.
id string
The ID of the session.
invoiceId string
The ID of the invoice that the session has. Null if no invoice was created for the checkout session.
items AuthCheckoutSessionItem[]
The items that are in the checkout session.
paid boolean
Whether the checkout session has been paid for or not.
shouldBeAutomaticallyFulfilled? boolean
Whether the checkout session should be automatically fulfilled once payment completes.
stripeCheckoutSessionId string
The ID of the stripe checkout session that is associated with this session. If null, then the session is not associated with a stripe checkout session.
stripePaymentStatus CheckoutSessionPaymentStatus
The payment status of the checkout session.
stripeStatus CheckoutSessionStatus
The status of the checkout session.
transactionId? string
The transaction ID that should be associated with the checkout session.
transferIds? string[]
The transfers that have been posted for the checkout session.
transfersPending? boolean
Wether the transfers are currently pending.
userId string
The ID of the user that the checkout session is for.
AuthController
Defines a class that is able to authenticate users.
Members
privoClient PrivoClientInterface
privoEnabled boolean
relyingParties RelyingParty[]
constructor(authStore: AuthStore, messenger: AuthMessenger, configStore: ConfigurationStore, recordsStore: RecordsStore, privoClient: PrivoClientInterface, relyingParties: RelyingParty[]): AuthController
The first parameter is a AuthStore and
The second parameter is a AuthMessenger and
The third parameter is a ConfigurationStore and
The fourth parameter is a RecordsStore and
The fifth parameter is a PrivoClientInterface and
The parameter is a RelyingParty[] and
completeLogin(request: CompleteLoginRequest): Promise<CompleteLoginResult>
The first parameter is a CompleteLoginRequest and
completeOpenIDLogin(request: CompleteOpenIDLoginRequest): Promise<CompleteOpenIDLoginResult>
The first parameter is a CompleteOpenIDLoginRequest and
completeWebAuthnLogin(request: CompleteWebAuthnLoginRequest): Promise<CompleteWebAuthnLoginResult>
The first parameter is a CompleteWebAuthnLoginRequest and
completeWebAuthnRegistration(request: CompleteWebAuthnRegistrationRequest): Promise<CompleteWebAuthnRegistrationResult>
The first parameter is a CompleteWebAuthnRegistrationRequest and
createAccount(request: CreateAccountRequest): Promise<CreateAccountResult>
The first parameter is a CreateAccountRequest and
deleteUserAuthenticator(userId: string, authenticatorId: string): Promise<DeleteUserAuthenticatorResult>
The first parameter is a string and
The second parameter is a string and
getPrivateInfoForUser(user: AuthUser): Promise<GetUserInfoSuccess>
Gets the user info for the given auth user.
Not for public use.
The first parameter is a AuthUser and is the user to get the info for.
getPublicUserInfo(userId: string): Promise<GetPublicUserInfoResult>
Gets the public information for a specific user.
The first parameter is a string and is the ID of the user whose information is being requested.
getUserInfo(request: GetUserInfoRequest): Promise<GetUserInfoResult>
Gets the information for a specific user.
The first parameter is a GetUserInfoRequest and is the request.
isValidDisplayName(displayName: string, name?: string): Promise<IsValidDisplayNameResult>
The first parameter is a string and
The second parameter is optional and is a string and
isValidEmailAddress(email: string): Promise<IsValidEmailAddressResult>
The first parameter is a string and
issueSession(request: IssueSessionRequest): Promise<IssueSessionResult>
The first parameter is a IssueSessionRequest and
listEmailRules(): Promise<ListEmailRulesResult>
Lists the email rules that should be used.
listSessions(request: ListSessionsRequest): Promise<ListSessionsResult>
Lists all the sessions for a given user.
The first parameter is a ListSessionsRequest and is the request.
listSmsRules(): Promise<ListSmsRulesResult>
Lists the SMS rules that should be used.
listUserAuthenticators(userId: string): Promise<ListUserAuthenticatorsResult>
The first parameter is a string and
processOpenIDAuthorizationCode(request: ProcessOpenIDAuthorizationCodeRequest): Promise<ProcessOpenIDAuthorizationCodeResult>
The first parameter is a ProcessOpenIDAuthorizationCodeRequest and
replaceSession(request: ReplaceSessionRequest): Promise<ReplaceSessionResult>
Attempts to replace the given session key with a new key.
The first parameter is a ReplaceSessionRequest and is the request.
requestLogin(request: LoginRequest): Promise<LoginRequestResult>
The first parameter is a LoginRequest and
requestOpenIDLogin(request: OpenIDLoginRequest): Promise<OpenIDLoginRequestResult>
The first parameter is a OpenIDLoginRequest and
requestPrivacyFeaturesChange(request: RequestPrivacyFeaturesChangeRequest): Promise<RequestPrivacyFeaturesChangeResult>
Attempts to request a change in privacy features for a user.
The first parameter is a RequestPrivacyFeaturesChangeRequest and
requestPrivoSignUp(request: PrivoSignUpRequest): Promise<PrivoSignUpRequestResult>
The first parameter is a PrivoSignUpRequest and
requestWebAuthnLogin(request: RequestWebAuthnLogin): Promise<RequestWebAuthnLoginResult>
The first parameter is a RequestWebAuthnLogin and
requestWebAuthnRegistration(request: RequestWebAuthnRegistration): Promise<RequestWebAuthnRegistrationResult>
The first parameter is a RequestWebAuthnRegistration and
revokeAllSessions(request: RevokeAllSessionsRequest): Promise<RevokeAllSessionsResult>
Attempts to revoke all the sessions for the specified user.
The first parameter is a RevokeAllSessionsRequest and is the request.
revokeSession(request: RevokeSessionRequest): Promise<RevokeSessionResult>
The first parameter is a RevokeSessionRequest and
updateUserInfo(request: UpdateUserInfoRequest): Promise<UpdateUserInfoResult>
Attempts to update a user's metadata.
The first parameter is a UpdateUserInfoRequest and is the request for the operation.
validateConnectionToken(token: string): Promise<ValidateConnectionTokenResult>
The first parameter is a string and
validateSessionKey(key: string): Promise<ValidateSessionKeyResult>
The first parameter is a string and
verifyPasswordAgainstHashes(sessionSecret: string, sessionId: string, hashes: string[]): boolean
The first parameter is a string and
The second parameter is a string and
The third parameter is a string[] and
AuthInvoice
Members
checkoutSessionId string
The ID of the checkout session that this invoice is for. Null if no checkout session is associated with this invoice.
currency string
The three-letter ISO code for the currency that the invoice is in.
description string
The description of the invoice.
id string
paid boolean
Whether the invoice is paid.
periodId string
The ID of the subscription period that this invoice is for. Null if no subscription period is associated with this invoice.
status string
The status of the invoice.
stripeHostedInvoiceUrl string
The URL of the stripe hosted invoice. Users can use this to pay and see the invoice.
stripeInvoiceId string
The ID of the stripe invoice that is associated with this invoice.
stripeInvoicePdfUrl string
The URL of the stripe hosted invoice PDF.
subscriptionId string
The ID of the subscription that this invoice is for. Null if no subscription is associated with this invoice.
subtotal number
The subtotal of the invoice.
tax number
The amount of tax collected.
total number
The amount of the invoice in the smallest unit of the currency.
AuthLoginRequest
Defines an interface that represents the data a login request contains.
Members
address string
The address that the request is for.
addressType AddressType
The type of address that the request is for.
attemptCount number
The number of attempts made to complete the request.
completedTimeMs number
The unix timestamp in miliseconds that the request was completed at. If null, then the request has not been completed.
expireTimeMs number
The unix timestamp in miliseconds that the request will expire at.
ipAddress string
The IP Address that the request came from.
requestId string
The ID of the request.
requestTimeMs number
The unix timestamp in miliseconds that the request was made at.
secretHash string
The hash that the request should match.
userId string
The ID of the user that the login request is for.
AuthOpenIDLoginRequest
Defines an interface that represents a login request for an Open ID login.
Members
authorizationCode? string
The authorization code that was recieved for the request.
authorizationTimeMs? number
The unix timestamp that the authorization code was registered for the login request. Null/undefined if the request has not been authorized yet.
authorizationUrl string
The URL that was used as the authorization URL in the Open ID authorization code flow.
codeMethod string
The code challenge method that the Open ID authorization response should match.
codeVerifier string
The code that the Open ID authorization response should match.
completedTimeMs number
The unix timestamp in miliseconds that the request was completed at. If null, then the request has not been completed.
expireTimeMs number
The unix timestamp in miliseconds that the request will expire at.
ipAddress string
The IP Address that the request came from.
provider string
The name of the provider that was used for the Open ID login.
redirectUrl string
The URL that was used as the redirect URL in the Open ID authorization code flow.
requestId string
The ID of the request.
requestTimeMs number
The unix timestamp in miliseconds that the request was made at.
scope string
The scope that was requested.
state string
The state generated for the request.
AuthSession
Defines an interface that represents a login session for the user.
Members
connectionSecret string
The secret of the token that provides connection access to this session.
expireTimeMs number
The unix timestamp in miliseconds that the session will expire at. If null, then the session does not expire.
grantedTimeMs number
The unix timestamp in miliseconds that the session was granted at.
ipAddress string
The IP Address that the session was granted to.
nextSessionId string
The ID of the next session that replaced this session.
oidAccessToken? string
The access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.
oidExpiresAtMs? number
The unix timestamp in seconds that the oidAccessToken expires at. If null, then Open ID was not used for the session.
oidIdToken? string
The ID token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.
oidProvider? string
The name of the Open ID provider that was used to obtain this session. If null, then Open ID was not used for the session.
oidRefreshToken? string
The refresh token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.
oidRequestId? string
The ID of the OpenID login request that aws used to obtain this session.
oidScope? string
The Open ID scope that was granted to the session. If null, then Open ID was not used for the session.
oidTokenType? string
The type of the access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.
previousSessionId string
The ID of the previous session that was used to obtain this session.
requestId string
The ID of the login request that was used to obtain this session.
revocable? boolean
Whether the session is able to be revoked by the user. Setting this to false will prevent the user from revoking the session. Additionally, users will not be able to replace the session either. If false, then the session cannot be revoked by the user. If true, then the session can be revoked by the user. Default is true.
revokeTimeMs number
The unix timestamp in miliseconds that the session was revoked at. If null, then the session has not been revoked.
secretHash string
The hash of the token that provides access to this session.
sessionId string
The ID of the session.
userId string
The ID of the user that the session is for.
webauthnRequestId? string
The ID of the WebAuthn login request that was used to obtain this session.
AuthSessionInfo
Members
connectionKey string
The connection key that provides websocket access for the session.
expireTimeMs number
The unix timestamp in miliseconds that the session will expire at. If null, then the session will not expire.
metadata UserLoginMetadata
Extra metadata for the user.
sessionKey string
The secret key that provides access for the session.
userId string
The ID of the user that the session is for.
AuthStore
Defines an interface that represents an auth store.
Members
createActivationKey(key: ActivationKey): Promise<void>
Creates the given activation key.
The first parameter is a ActivationKey and is the key.
deleteUserAuthenticator(userId: string, authenticatorId: string): Promise<number>
Deletes the authenticator with the given ID. Returns the number of items that were deleted.
The first parameter is a string and is the ID of the user whose authenticator should be deleted.
The second parameter is a string and is the ID of the authenticator that should be deleted.
findLoginRequest(userId: string, requestId: string): Promise<AuthLoginRequest>
Finds a login request for the given user and request ID.
The first parameter is a string and is the ID of the user.
The second parameter is a string and is the ID of the request.
findOpenIDLoginRequest(requestId: string): Promise<AuthOpenIDLoginRequest>
Finds the login request for the given request ID.
The first parameter is a string and is the ID of the Open ID login request.
findOpenIDLoginRequestByState(state: string): Promise<AuthOpenIDLoginRequest>
Finds the login request for the given state.
The first parameter is a string and is the state that the request contains.
findSession(userId: string, sessionId: string): Promise<AuthSession>
Finds a login session for the given user and session ID.
The first parameter is a string and is the ID of the user.
The second parameter is a string and is the ID of the session.
findUserAuthenticatorByCredentialId(credentialId: string): Promise<AuthUserAuthenticatorWithUser>
Finds the authenticator with the given credentialId. Includes the user that the authenticator is for. Returns an object with null properties if the authenticator could not be found.
The first parameter is a string and is the ID of the credential that the authenticator should represent.
findUserByAddress(address: string, addressType: AddressType, loginStudioId?: string): Promise<AuthUser>
Finds the user that represents the given address.
The first parameter is a string and is the address.
The second parameter is a AddressType and is the type of the address.
The third parameter is optional and is a string and is the ID of the studio that the user is logging into.
findUserLoginMetadata(userId: string): Promise<UserLoginMetadata>
Finds the metadata for the given user ID. If the user does not exist, then null is returned.
The first parameter is a string and is the ID of the user.
findWebAuthnLoginRequest(requestId: string): Promise<AuthWebAuthnLoginRequest>
Finds the WebAuthn login request with the given request ID.
The first parameter is a string and is the ID of the request.
getActivationKeyById(keyId: string): Promise<ActivationKey>
Gets the activation key with the given ID. Returns null if the key could not be found.
The first parameter is a string and is the ID of the key.
getCheckoutSessionById(id: string): Promise<AuthCheckoutSession>
Gets the checkout session with the given ID. Returns null if the session could not be found.
The first parameter is a string and is the ID of the checkout session.
getInvoiceById(id: string): Promise<AuthInvoice>
Gets the invoice with the given ID.
The first parameter is a string and is the ID of the invoice.
getInvoiceByStripeId(id: string): Promise<AuthInvoice>
Gets the invoice with the given stripe ID.
The first parameter is a string and is the ID of the invoice.
getSubscriptionById(id: string): Promise<AuthSubscription>
Gets the subscription with the given ID.
The first parameter is a string and is the ID of the subscription.
getSubscriptionByStripeSubscriptionId(id: string): Promise<AuthSubscription>
Gets the subscription with the given stripe subscription ID.
The first parameter is a string and is the ID of the stripe subscription.
getSubscriptionPeriodById(id: string): Promise<AuthSubscriptionPeriod>
Gets the subscription period with the given ID.
The first parameter is a string and is the ID of the subscription period.