Add logic for setting name and chat in demo page