Skip to main content

Permalink

The Eyeson SDK provides helper methods through the Permalink API that simplify integration of permalink functionality into any custom user interface built with EyesonJS. These methods enable seamless management of persistent meeting links and associated user access.

Available since version 1.9.3

Join as host user

The SDK provides a dedicated connectPermalink() method for host users as an alternative to the standard connection approach. When you call this method with a valid permalink user token, it automatically resolves the token and initiates the meeting session. This streamlined approach handles the permalink resolution process internally, allowing host users to establish connections to persistent meeting rooms with minimal configuration.

import eyeson from "@eyeson/js";

eyeson.onEvent(event => {
if (event.type === 'permalink_ready') {
console.log('Permalink is resolved and meeting is started');
}
if (event.connectionStatus === 'connected') {
eyeson.join({ audio: true, video: true });
}
});
eyeson.connectPermalink(userToken);

See more about the eyeson.connect() function.

Join as guest

Guest users need to verify the meeting is active before joining. The SDK provides mechanisms to check the meeting state and obtain the necessary access tokens for guest participants.

When a guest attempts to join, the system will automatically verify if the meeting has been started by a host and provide the appropriate status information.

import eyeson from "@eyeson/js";

eyeson.onEvent(event => {
if (event.type === 'error') {
if (event.content.includes('expired')) {
// permalink expired
}
}
if (event.type === 'permalink_meeting_info') {
if (event.room.started_at === null) {
// need to wait
}
else {
// allow join, for example enable join button
}
}
if (event.type === 'guest_user') {
// "event.token" is the user's actual access_key for eyeson.start()
}
});

// for example invoke when join button is pressed
const onJoin = () => {
eyeson.send({
type: 'request_guest_user',
api: eyeson.config.api,
name: '<user name>',
token, // permalink guest-token
locale,
});
};

eyeson.send({
type: 'request_permalink_meeting_info',
api: eyeson.config.api, // set api as Eyeson is not yet initialized
token, // permalink guest-token
});
tip

Note: The request_permalink_meeting_info command initiates a polling mechanism that automatically checks the meeting status every 5 seconds. This means the permalink_meeting_info event will be triggered repeatedly until the meeting is actively running, allowing your application to respond when the host initiates the session.

Get more information about guest access.