new pub()
The public object which is returned by the EasyRTC listen() function. Contains all public methods for interacting with EasyRTC server.
- Source:
Classes
Methods
-
<static> app(appName, callback)
-
Contains the methods for interfacing with an EasyRTC application. The callback will receive an application object upon successful retrieval of application. The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError. The function does return an application object which is useful for chaining, however the callback approach is safer and provides additional information in the event of an error.
Parameters:
Name Type Argument Description appName
string <nullable>
Application name which uniquely identifies it on the server. Uses default application if null. callback
appCallback <optional>
Callback with error and application object - Source:
-
<static> createApp(appName, options, callback)
-
Creates a new EasyRTC application with default values. If a callback is provided, it will receive the new application object. The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError.
Parameters:
Name Type Argument Description appName
string Application name which uniquely identifies it on the server. options
object <nullable>
Options object with options to apply to the application. May be null. callback
appCallback <optional>
Callback with error and application object - Source:
-
<static> getAppNames(callback)
-
Sends an array of all application names to a callback.
Parameters:
Name Type Description callback
function Callback with error and array containing all application names. - Source:
-
<static> getAppWithEasyrtcid(easyrtcid, callback)
-
Gets app object for application which has an authenticated client with a given easyrtcid
Parameters:
Name Type Description easyrtcid
String Unique identifier for an EasyRTC connection. callback
function Callback with error and application object - Source:
-
<static> getConnectionWithEasyrtcid(easyrtcid, callback)
-
Gets connection object for connection which has an authenticated client with a given easyrtcid
Parameters:
Name Type Description easyrtcid
string EasyRTC unique identifier for a socket connection. callback
function Callback with error and connection object - Source:
-
<static> getOption(option) → {*}
-
Gets individual option value. The option value returned is for the server level. Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
Parameters:
Name Type Description option
String Option name - Source:
Returns:
Option value (can be any JSONable type)- Type
- *
-
<static> getVersion() → {string}
-
Gets EasyRTC Version. The format is in a major.minor.patch format with an optional letter following denoting alpha or beta status. The version is retrieved from the package.json file located in the EasyRTC project root folder.
- Source:
Returns:
EasyRTC Version- Type
- string
-
<static> isApp(appName, callback)
-
Determine if a given application name has been defined.
Parameters:
Name Type Description appName
string Application name which uniquely identifies it on the server. callback
function Callback with error and boolean of whether application is defined. - Source:
-
<static> setOption(option, value) → {Boolean}
-
Sets individual option. The option value set is for the server level. Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
Parameters:
Name Type Description option
Object Option name value
Object Option value - Source:
Returns:
true on success, false on failure- Type
- Boolean