and the URL in the src attribute is your Chat Room URL in our case it is: https://deadsimplechat.com/-eZxgepn9
Step 2: Passing the username
Now that we have obtained our embed code and the chat room url, we can pass the username as a query parameter to the chat room, like this:
In the above snippet https://deadsimplechat.com/-eZxgepn9 is our chat room url and ?username= is username key bob is the value i.e name of the user and it should be replaced by the actual name of the user.
And the complete iFrame code would look something like this:
In the above example we have passed the username: "bob" now the user will be logged-in to the chat room automatically and will have a username set as bob.
You would have to replace the bob with the actual username of the user, this varies upon your app on how you retrieve the username of the logged-in user, and once you have the username you can pass it as a parameter to the chatRoom to login the user automatically.
Bonus: Setting random usernames for users and logging them in automatically
In Dead Simple Chat, the users have to set a username before they can join the chat room, but suppose you want to have a chat room, so that all the users are logged-in with the username guest.