Edit in GitHubLog an issue

Initialize SDK

Description#

Use the Create method in order to initialize the .NET SDK and instantiate the Target Client to make calls to Adobe Target for experiments and personalized experiences.

When using .NET Dependency Injection, just add the SDK at service configuration step by calling services.AddTargetLibrary();, then inject ITargetClient targetClient in your app's constructor.

After this, use the Initialize method of the SDK to configure the SDK, thus completing the initialization step.

Method#

TargetClient is created using TargetClient.Create.

Copied to your clipboard
TargetClient TargetClient.Create(TargetClientConfig clientConfig)

ClientConfig is created using ClientConfig.Builder.

Copied to your clipboard
TargetClientConfig.Builder TargetClientConfig.Builder()

Parameters#

TargetClientConfig.Builder has the following structure:

NameTypeRequiredDefaultDescription
ClientstringYesNoneTarget Client Id
OrganizationIdstringYesNoneExperience Cloud Organization ID
TimeoutintNo10000Timeout for all requests in milliseconds
ProxyWebProxyNonull
RetryPolicyPolicyNonullRetry Policy for all Target requests
AsyncRetryPolicyAsyncPolicyNonullAsync Retry Policy for all Target requests
LoggerILoggerNonullUsed for debug logging of Target requests and responses
ServerDomainstringNoclient.tt.omtrdc.netOverrides default hostname
SecureboolNotrueUnset to enforce HTTP scheme
DefaultPropertyTokenstringNonullSets the default property token for every getOffers call
TelemetryEnabledboolNotrueSend telemetry data for improving SDK usage experience
DecisioningMethodDecisioningMethod enumNoServerSideMust be set to OnDevice or Hybrid to enable on-device decisioning
OnDeviceDecisioningReadyActionNonullDelegate for on-device decisioning Ready event (called once when on-device decisioning is ready)
ArtifactDownloadSucceededActionNonullDelegate for on-device decisioning artifact download success (called on each successful artifact download)
ArtifactDownloadFailedActionNonullDelegate for on-device decisioning artifact download failure (called on each failed artifact download)
OnDeviceEnvironmentstringNoproductionCan be used to specify a different on-device environment such as staging
OnDeviceConfigHostnamestringNoassets.adobetarget.comCan be used to specify a different host to use to download the on-device decisioning artifact file
OnDeviceDecisioningPollingIntSecsintNo300 (5 min)Number of seconds between fetches of the on-device decisioning artifact file
OnDeviceArtifactPayloadstringNonullProvides on-device decisioning with a local artifact payload to allow immediate execution

Example#

Copied to your clipboard
1var targetClientConfig = new TargetClientConfig.Builder("acmeclient", "ABCDEF012345677890ABCDEF0@AdobeOrg")
2 .Build();
3
4targetClient = TargetClient.Create(targetClientConfig);
5
6// make calls to Adobe Target
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.