pubnub

How to generate pubnub UUID?


I building chat application with pubnub,

I have setup everything both backend and frontend,

but in front-end, it requires another argument for UUID. Can anyone tell me where can i get the UUID? how to generate it with pubnub? Do i need to store the UUID in my datbase?

const pubnub = new PubNub({
  publishKey: 'myPublishKey',
  subscribeKey: 'mySubscribeKey',
  uuid: 'myUniqueUUID'
});

Pubnub docs it seems worst, i have not found any information regarding generating UUID, Can anyone tell me how can i resolve it?


Solution

  • PubNub UUID Management Best Practices

    The UUID should be something that, as the acronym implies, uniquely identifies the user (or device, server instance, etc.). The UUID can be whatever you see fit to accomplish this in your applications but there are some guidelines you should follow with respect to PubNub.

    This is well-documented in the PubNub Platform Documentation, so I am not going to repeat all of that here. Please review Users & Devices: Identity Management docs, under the Connections section, for the full story.

    TL;DR

    Why are UUIDs Important in PubNub?

    Again, it's all detailed in the same docs page under the UUID Impact section, but here's the highlights:

    Have a Realtime Day!!! ;)