Skip to main content

Connection

Connection represents a single Connection to create a ProCONF Room.

Kind: global class

connection.init(domain, [proconfToken]) ⇒ Promise

Initializes the Call libraries connection with the provided connection options.

Kind: instance method of Connection
Returns: Promise - A promise that resolves to the backend connection object.
Throws:

  • ProConfError If the connection to backend server fails.

Fulfil: Connection connection object
Reject: ProconfError On connection error

ParamTypeDefaultDescription
domainstringThe domain of the backend server to connect to.
[proconfToken]stringnullThe ProCONF token to be used for authentication.

connection.createRoom([roomOptions]) ⇒ Promise

Creates a new room with the specified room name and room options. If room name is not provided, a random room name will be generated.

Kind: instance method of Connection
Returns: Promise - A Promise that resolves to the created Room object.
Throws:

  • ProConfError if the room could not be initialized.

Fulfil: Room object
Reject: ProconfError On room creation error

ParamTypeDescription
[roomOptions]RoomOptionsThe options for the room.

connection.getRoom() ⇒ Room | null

Gets a Room instance of the connection

Kind: instance method of Connection
Returns: Room | null - Associated Room instance or null if no room has been joined

connection.disconnect() ⇒ void

Disconnects the connection.

Kind: instance method of Connection

Connection.Events

Kind: static Event of Connection
Properties

NameTypeDescription
connectionEstablishedConnectionEstablishedEventConnection joined event
connectionDisconnecedConnectionDisconnectedEventConnection disconnected disconnected event
connectionFailedConnectionFailedEventindicating that a connection has failed
connectionRedirectedConnectionRedirectedEventindicating that a connection has been redirected