FuelSDK-CSharp
FuelSDK-CSharp copied to clipboard
What Lifetime/Lifestyle should ETClient be?
The documentation is not clear as to what the lifetime/lifestyle should be configured for the ETClient. If i were to guess it's really trying to say singleton. Without singleton then caching and refreshing of tokens would be pretty useless feature. Can someone confirm this?
https://github.com/salesforce-marketingcloud/FuelSDK-CSharp/blob/aebf1e071723a6686ac567bc2c25bbdab14d54a0/README.md#example-request
The ETClient class takes care of many of the required steps when accessing Salesforce Marketing Cloud's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new ETClient object for each request made.
Thanks!
Also, if you have a single application that is responsible for sending emails for multiple business units will creating 2 singletons ETClient Singletons be problematic?
Cc @gdu-sf