Web Messaging SDK: Passing CRM ID into startChat()

Trying to push a customer ID into the Web Messaging SDK before the chat starts. I’ve got the standard init block set up, but I can’t find a param for startChat() to accept custom metadata like crmId: '12345'. Is there a way to inject this via the onChatRequest callback or do I have to hack the widget settings? Here’s my current setup:

const widget = new Widget({
 orgGuid: 'my-org-guid',
 // ... config
});

widget.startChat(); // Stuck here

The goal is to have that ID available in the routing data immediately.

You don’t pass it in startChat(). Set the data in the onChatRequest callback instead.

widget.onChatRequest((req) => {
 req.customAttributes = { crmId: '12345' };
 return req;
});