Skip to content

Chat SDK + Access Manager #180

Open
Open
@manfe

Description

@manfe

When Access Manager is enabled I am initializing the Chat SDK with:

const chatInstance = await Chat.init({
    publishKey: process.env.NEXT_PUBLIC_PUBNUB_PUBLISH_KEY,
    subscribeKey: process.env.NEXT_PUBLIC_PUBNUB_SUBSCRIBE_KEY,
    userId: "user-id-example",
    authKey: "my-token" // This authKey is the Access Manager authorized token
})

But if I need to update the access manager token after a period of time, I noticed that the pubnub is wrapped into the sdk property.

Is it ok to update the Access Manager token using the method below?

chatInstance.sdk.setToken("my-new-token")

Or there is other recommended way to do it?

Also if I need to listen 403 errors I continue listening on that sdk property?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions