Global

Type Definitions

ClientAuth

Source:
Properties:
Name Type Attributes Description
orgEphemeralToken string <optional>

Org ephemeral user token created at https://app.forsta.io/authtokens.

jwt string <optional>

An existing JSON Web Token for a Forsta user account. Note that the JWT may be updated during use. Subscribe to the jwtupdate event to handle updates made during extended use.

Auth is a single value union. Only ONE property should be set.

Type:
  • Object

ClientOptions

Source:
Properties:
Name Type Attributes Default Description
onInit function <optional>

Callback to run when client is first initialized.

onLoaded function <optional>

Callback to run when client is fully loaded and ready to use.

url string <optional>
https://app.forsta.io/@

Override the default site url.

showNav bool

Unhide the navigation panel used for thread selection.

showHeader bool

Unhide the header panel.

showThreadAside bool

Unhide the optional right aside panel containing thread info.

showThreadHeader bool

Unhide the thread header panel.

ephemeralUserInfo EphemeralUserInfo

Details about the ephemeral user to be created or used. Only relevant when orgEphemeralToken auth is used.

openThreadId null | ThreadID

Force the messenger to open a specific thread on startup. If the value is null it will force the messenger to not open any thread.

Type:
  • Object

EphemeralUserInfo

Source:
Properties:
Name Type Attributes Description
firstName string <optional>

First name of the user.

lastName string <optional>

Last name of the user.

email string <optional>

Email of the user.

phone string <optional>

Phone of the user. NOTE: Should be SMS capable.

salt string <optional>

Random value used to distinguish user accounts in advanced use-cases.

Information about the ephemeral user that will be created or reused for this session.

Type:
  • Object

MessageID

Source:

The ID for a message.

Type:

TagExpression

Source:
See:

Forsta tag expressions are any combination of tag identifiers (user or group). They can include logical operators such as plus "+" and minus "-" to explicitly add and remove certain users or groups from a distribution. E.g...

(@macy:acme + @jim:nasa + @sales:nsa) - @drunk:uncle
Type:
  • string

ThreadAttributes

Source:
Properties:
Name Type Description
id string

The thread identifier (UUID).

type 'conversation' | 'announcement'

The type of thread this is.

title string

Optional title for this thread.

distribution string

The normalized tag expression for this thread.

The various internal attributes a thread model has.

Type:
  • Object

ThreadID

Source:

The ID for a messaging thread. Every thread must have a unique identifier which is shared amongst peers to distinguish conversations.

Type:

Timestamp

Source:

Milliseconds since Jan 1 1970 UTC.

Type:
  • number

UserID

Source:

The ID for a user in the Forsta ecosystem.

Type:

UUID

Source:

A case-sensitive string value in UUID format. E.g. "93fad4a7-bfa6-4f84-ab4d-4ed67e1d2658"

Type:
  • string

Events

init

Source:

The client application has been initialized. This is emitted shortly after successfully starting up, but before the messenger is fully loaded. Use the loaded event to wait for the client application to be completely available.

Type:
  • object

loaded

Source:

The client application is fully loaded and ready to be controlled.

Type:
  • object

provisioningdone

Source:

When provisioning has finished successfully this event is emitted.

Type:
  • object

provisioningerror

Source:
Properties:
Name Type Description
error Error

The error object.

If an error occurs during provisioning it will be emitted using this event.

Type:
  • object

provisioningrequired

Source:

This event is emitted if the application requires the user to perform provisioning of their Identity Key.

Type:
  • object

thread-message

Source:
Properties:
Name Type Description
id MessageID

The message ID.

threadId ThreadID

The ID of the thread this message belongs to.

Thread message event. Emitted when a new message is added, either by sending or receiving.

Type:
  • object

thread-message-readmark

Source:
Properties:
Name Type Description
threadId ThreadID

The ID of the thread this readmark pertains to.

source UserID

The peer user id that sent the readmark.

readmark Timestamp

The timestamp of the readmark. E.g. How far the user has read to.

Thread message readmark change event. Read marks indicate the most recent messages read by a peer for a given thread. They are timestamp values that correspond to the message timestamps.

Type:
  • object