Edit in GitHubLog an issue

Initialize SDK

Description#

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

Method#

TargetClient is created using TargetClient.create.

Copied to your clipboard
TargetClient TargetClient.create(ClientConfig clientConfig)

ClientConfig is created using ClientConfig.builder.

Copied to your clipboard
ClientConfigBuilder ClientConfig.builder()

Parameters#

ClientConfigBuilder has the following structure:

NameTypeRequiredDefaultDescription
clientStringYesNoneTarget Client Id
organizationIdStringYesNoneExperience Cloud Organization ID
connectTimeoutNumberNo10000Connection timeout for all requests in milliseconds
socketTimeoutNumberNo10000Socket timeout for all requests in milliseconds
maxConnectionsPerHostNumberNo100Max Connections per Target host
maxConnectionsTotalNumberNo200Max Connections including all Target hosts
enableRetriesBooleanNotrueAutomatic retries for socket timeouts (max 4)
logRequestsBooleanNofalseLog Target requests and responses in debug
logRequestStatusBooleanNofalseLog Target response time, status, and URL
serverDomainStringNoclient.tt.omtrdc.netOverrides default hostname
secureBooleanNotrueUnset to enforce HTTP scheme
requestInterceptorHttpRequestInterceptorNoNullAdd custom request Interceptor
defaultPropertyTokenStringNoNoneSets the default property token for every getOffers call. For on-device decisioning, the SDK will only download the artifact that contains the qualified activities for the property token set in defaultPropertyToken
defaultDecisioningMethodDecisioningMethod enumSERVER_SIDEMust be set to ON_DEVICE or HYBRID to enable on-device decisioning
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 minutes)Number of seconds between fetches of the on-device decisioning artifact file
onDeviceArtifactPayloadbyte[]NoNoneProvides on-device decisioning with previous artifact payload to allow immediate execution
onDeviceDecisioningHandlerOnDeviceDecisioningHandlerNoNoneRegisters callbacks for on-device decisioning events

Example#

Copied to your clipboard
1ClientConfig clientConfig = ClientConfig.builder()
2 .client("acmeclient")
3 .organizationId("1234567890@AdobeOrg")
4 .build();
5
6TargetClient.create(clientConfig);
7
8// 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.