The Space Widget allows you to open a space to a given space id, user id, or email.
The widget goes through different workflows depending on which type of space you are opening.
The Space Widget requires two identifiers for the space: destination id and destination type.
Destination type determines what kind of space you are trying to open. It can be one of three values:
- "email"
- "userId"
- "spaceId"
- "sip"
If destination type is "email", then simply pass a string containing the email of the user you would like to open the space with.
If the destination type is either "userId" or "spaceId", you can pass the encoded ID provided by the developer portal.
If the destination type is "sip", you can pass a SIP URI.
When the widget initializes, it processes the destination to understand which "conversation" to load from the API.
The "spaceId" destination type is the most straightforward space for processing.
The "destinationId" is converted from a hydra ID to a UUID (if necessary), then the conversation details are fetched from the /rooms
endpoint with the UUID.
The "email" destination type allows a user to open a direct space to the account with the given email address. The space widget uses the conversation service to get space details for direct spaces. This is due to the fact that the /rooms
endpoint doesn't currently have a way to look up space details without a room id.
The space widget follows a workflow of data fetching and processing in order to be fully setup.
- The JS SDK is authenticated and registered as a device
- Does something say the widget needs to reloaded?
- Reload the widget and start over
- The JS SDK connects to web socket for real time data
- Widget fetches space details about the destination
- Gets user details for 1:1 spaces
- Fetches space details via
/rooms
api endpoint
Once all of these items are successful, the space widget is considered "ready" and the other widgets (message, meet, people, etc) will start their loading process.