Hi @TomLaizy,
This depends on whether you want to use the Hosted Chat or Embedded Chat option. Hosted chat would be a standalone chat interface provided by n8n and easy to setup, but if you want to integrate the chat functionality into your own website (e.g. Wordpress) I recommend choosing the Embedded option.
Embedded Chat
In embedded chat, you can include custom metadata (e.g. wordpress_id
) directly in the createChat
function when embedding the chat on your own webpage. The metadata can be any json object and that should get passed along in the Chat Trigger:
createChat({
webhookUrl: 'your-webhook-url',
metadata: {
wordpress_id: 'username',
wordpress_email: '[email protected]'
},
});
See @n8n/chat - npm for details. There’s also a similar post here.
Hosted Chat
In a hosted chat, if you set an Authentication, the chat will pass on the user details in the metadata (e.g. if you select n8n User Auth you’ll see the n8n user details in the metadata like so:
Here’s a related post: Is there a way to pass query parameters in the Chat trigger? - #3 by miguel-mconf
Hope that helps!