Web Messaging SDK: Custom guest attributes not persisting after login redirect

Hey everyone,

I’m hitting a wall with the Web Messaging SDK (v5.2.1) when trying to set custom guest attributes for authenticated users. We’ve got a hybrid setup where users log in via our main app, get a JWT, and then I initialize the Genesys widget.

The goal is to pass the user_id and email as custom attributes so we can filter conversations in the dashboard without relying on the default email guessing.

Here’s the init config I’m using:

const config = {
 organizationId: 'my-org-id',
 deploymentId: 'my-deployment-id',
 customAttributes: {
 userId: session.userId,
 userEmail: session.email
 }
};

genesyscloud.init(config);

When the widget loads on the initial page, the attributes show up fine in the Genesys UI. The issue is when the user navigates to a new page (React SPA) and I re-init the widget. The customAttributes seem to drop off, or rather, the guest session resets and the new attributes don’t stick to the existing guest ID.

I tried using the updateGuest API endpoint directly from the frontend:

PUT /api/v2/conversations/messaging/guests/{guestId}

But I’m getting a 401 Unauthorized. I assumed the widget would handle auth, but it seems the guest token isn’t valid for that endpoint. I also tried using the guest.updateAttributes method in the SDK, but it’s throwing a “Method not found” error in the console.

Is there a specific sequence I’m missing? I’ve checked the docs on guest identity, but nothing explicitly covers passing persistent attributes across page loads without a full re-auth flow. Any pointers would be appreciated.