microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.6k stars 1.55k forks source link

Developers should be able to set their own User Agent #2119

Open tdurnford opened 5 years ago

tdurnford commented 5 years ago

Description

Currently, Web Chat is responsible for handling the User Agent string in the createDirectLine function and does not allow developers to append to or replace it with their own user agent. We should change this behavior to allow developers to modify Web Chat's user agent string.

In pull request #2101, @compulim listed three approaches to letting developers modify the user agent string.

  1. Devs can somehow get/construct Web Chat default user agent string, and they should append it when they set botAgent
  2. Devs can set appName and appVersion and we help append to the bot agent
  3. Devs set bot agent, but internally in Web Chat, we append to it
    • Not how other systems handle user agent

Of the three, I believe the first option is the best approach since it's more in line with how other platforms handle user agent - Facebook, Instagram, and Twitter - and gives the developer more freedom; however, this option does imply that the developer is responsible for appending Web Chat's user agent - "(webchat/x.y.z (Full)." This behavior should probably be mirrored in the DirectLineJs package as well.

Additional Context Related to #1985

[Enhancement]

corinagum commented 4 years ago

This would help the service side let us know how many customers are using different versions of Web Chat.