DoctorMcKay / node-steam-session

Node.js module for authenticating with the Steam auth server. Allows for generating refresh tokens and web auth cookies for use with steam-user and other packages.
https://www.npmjs.com/package/steam-session
MIT License
117 stars 22 forks source link

export of user-agent #34

Closed k1de closed 1 year ago

k1de commented 1 year ago

@DoctorMcKay, could you please add an export of webUserAgent and mobileUserAgent, this is useful if we want to use the same user-agent in requests outside of the module and get it from module updates.

DoctorMcKay commented 1 year ago

If you want to be sure the same user agent is used, you should set it explicitly yourself.

k1de commented 1 year ago

Yes, of course @DoctorMcKay , I can use userAgent option for webUserAgent from version v1.6.0, great!

But the request is to ensure backward compatibility in requests outside of the module for both webUserAgent and mobileUserAgent (I don’t think it will change soon, but it gives a feeling of security), and also with updating the module to receive updated “user-agent”.

after update v1.6.0 to get webUserAgent I can use some like import { chrome } from '@doctormckay/user-agents' or import { defaultUserAgent } from 'steam-session/dist/helpers.js' after update v1.6.0 I can't get mobileUserAgent.

In any case, thank you very much for your answer and your work.

DoctorMcKay commented 1 year ago

Sorry, this isn't something for which I want to increase the complexity of the public API contract. If you need to be sure that the same user-agent is being used, then you should define it yourself.

As for the mobile user-agent, that use case should be fixed by adding an option to specify your own mobile user-agent (and device name) details (#35).