Connect ChatEngine.Me

Connect to ChatEngine.Me

Once ChatEngine has connected the default global channels, ChatEngine will create a ChatEngine.Me class which extends the ChatEngine.User class.

Note: ChatEngine.User is an extension of the ChatEngine.Emitter class.

Similar to connecting to ChatEngine.global, ChatEngine then uses the PubNub ChatEngine Function controller to grant user access to their ChatEngine.Me chat channels. The access control levels defined for the Me chat channels restrict other Users from reading or writing content on that channel.

HTTP method controller* read write channels channelGroups authKeys ttl [sec]
POST grant true true [global#user#UUID#write.#direct,
global#user#UUID#write.#direct-pnpres]
[request.body.authKey] request.body.ttl
or
10800
POST grant true true [global#user#UUID#read.#feed,
global#user#UUID#read.#feed-pnpres]
[request.body.authKey] request.body.ttl
or
10800
POST** grant true true [global#user#UUID#me.#sync,
global#user#UUID#me.#sync-pnpres]
[request.body.authKey] request.body.ttl
or
10800

** The last row's grant request is only made if the user has configured ceConfig.enableSync: true

After each grant request, ChatEngine will make a join request to the PubNub ChatEngine Function controller in order to add the above channels to the system channelGroup.

Once the above has completed, ChatEngine will emit() a $.ready Event to signal a successful connection to ChatEngine.global and ChatEngine.Me .