I am hoping to clear up some confusion I have about using Pubnub with my Rails application. I am hoping to use Pubnub mainly for a chat layer among users. Users may be able to chat via iOS/Android/Web(rails) throughout the application.
** Pubnub gem is only used when creating an auth_key for user, and changing access with PAM. **
It seems to me that it is actually a serverless setup and Javascript SDK should be used instead of the Ruby SDK? The flow seems more likely to be:
- User registered through Devise
- After signed up, rails app server uses User's ID (or other uuid) to create an auth_key, stores it in the DB.
Logic when creating 1:1 chat in rails application
- Rails controller creates a channel, set the channel ID,
- creates access to the two peers.
Is this rougly the logic?
I am also not too sure whether it is okay to just put the pub_key and sub_key to the javascript client, it seems anybody can just use the pair to create all channels they want.