Class: appObj

appObj

new appObj()

The primary method for interfacing with an EasyRTC application.
Source:

Classes

connectionObj
roomObj
sessionObj

Members

<static> appObj.events

Expose all event functions
Source:

<static> appObj.util

Expose all utility functions
Source:

Methods

<static> appObj.connection(easyrtcid, callback)

Gets connection object for a given connection key. Returns null if connection not found. The returned connection object includes functions for managing connection fields.
Parameters:
Name Type Description
easyrtcid string EasyRTC unique identifier for a socket connection.
callback connectionCallback Callback with error and object containing EasyRTC connection object.
Source:

<static> appObj.createConnection(easyrtcid, callback)

Creates a new connection with a provided connection key
Parameters:
Name Type Description
easyrtcid string EasyRTC unique identifier for a socket connection.
callback function Callback with error and object containing EasyRTC connection object (same as calling connection(easyrtcid))
Source:

<static> appObj.createRoom(roomName, options, callback)

Creates a new room, sending the resulting room object to a provided callback.
Parameters:
Name Type Argument Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
options object <nullable>
Options object with options to apply to the room. May be null.
callback function Callback with error and object containing EasyRTC room object (same as calling appObj.room(roomName))
Source:

<static> appObj.createSession(easyrtcsid, callback)

Creates a new session with a provided easyrtcsid
Parameters:
Name Type Description
easyrtcsid string EasyRTC Session Identifier. Must be formatted according to "easyrtcsidRegExp" option.
callback function Callback with error and object containing EasyRTC session object (same as calling session(easyrtcsid))
Source:

<static> appObj.getAppName() → {string}

Returns the application name for the application. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The application name.
Type
string

<static> appObj.getConnectionEasyrtcids(callback)

Returns an array of all easyrtcid's connected to the application
Parameters:
Name Type Description
callback function Callback with error and array of easyrtcid's.
Source:

<static> appObj.getEasyrtcsids(callback)

Returns an array of all easyrtcsid's within the application
Parameters:
Name Type Description
callback function Callback with error and array containing easyrtcsid's.
Source:

<static> appObj.getField(Field, callback)

Returns application level field object for a given field name.
Parameters:
Name Type Description
Field string name
callback function Callback with error and field value (any type)
Source:

<static> appObj.getFields(limitToIsShared, callback)

Returns an object containing all field names and values within the application. Can be limited to fields with isShared option set to true.
Parameters:
Name Type Description
limitToIsShared boolean Limits returned fields to those which have the isShared option set to true.
callback function Callback with error and object containing field names and values.
Source:

<static> appObj.getGroupNames(callback)

Returns an array of all group names within the application
Parameters:
Name Type Description
callback function Callback with error and array of group names.
Source:

<static> appObj.getOption(option) → {*}

Gets individual option value. Will first check if option is defined for the application, else it will revert to the global level option.
Parameters:
Name Type Description
option String Option name
Source:
Returns:
Option value (can be any JSONable type)
Type
*

<static> appObj.getRoomNames(callback)

Returns an array of all room names within the application.
Parameters:
Name Type Description
callback function Callback with error and array of room names.
Source:

<static> appObj.group(Group, callback)

NOT YET IMPLEMENTED - Gets group object for a given group name. Returns null if group not found. The returned group object includes functions for managing group fields.
Parameters:
Name Type Description
Group string name
callback function Callback with error and object containing EasyRTC group object.
Source:

<static> appObj.isConnected(easyrtcid, callback)

Gets connection status for a connection. It is possible for a connection to be considered connected without being authenticated.
Parameters:
Name Type Description
easyrtcid string EasyRTC unique identifier for a socket connection.
callback function Callback with error and a boolean indicating if easyrtcid is connected.
Source:

<static> appObj.isRoom(roomName, callback)

Checks if a provided room is defined. The callback returns a boolean if room is defined
Parameters:
Name Type Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
callback function Callback with error and boolean of whether room is defined.
Source:

<static> appObj.isSession(callback)

Checks if a provided session is defined. The callback returns a boolean if session is defined
Parameters:
Name Type Description
callback function Callback with error and boolean of whether session is defined.
Source:

<static> appObj.room(roomName, callback)

Gets room object for a given room name. Returns null if room not found. The returned room object includes functions for managing room fields.
Parameters:
Name Type Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
callback function Callback with error and object containing EasyRTC room object.
Source:

<static> appObj.session(easyrtcsid, callback)

NOT YET IMPLEMENTED - Gets session object for a given easyrtcsid. Returns null if session not found. The returned session object includes functions for managing session fields.
Parameters:
Name Type Description
easyrtcsid string
callback function Callback with error and object containing EasyRTC session object.
Source:

<static> appObj.setField(fieldName, fieldValue, fieldOption, next)

Sets application field value for a given field name.
Parameters:
Name Type Argument Description
fieldName string Must be formatted according to "fieldNameRegExp" option.
fieldValue Object
fieldOption Object <nullable>
Field options (such as isShared which defaults to false)
next nextCallback <optional>
A success callback of form next(err).
Source:

<static> appObj.setOption(optionName, optionValue) → {Boolean}

Sets individual option. Set value to NULL to delete the option (thus reverting to global option).
Parameters:
Name Type Argument Description
optionName String Option name
optionValue * <nullable>
Option value
Source:
Returns:
true on success, false on failure
Type
Boolean