Edit in GitHubLog an issue

Initialize SDK


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


Copied to your clipboard
TargetClient.create(options: Object): TargetClient


options has the following structure:

ClientStringYesNoneAdobe Target client ID
organizationIDStringYesNoneExperience Cloud Organization ID
timeoutNumberNo3000Timeout in milliseconds
serverDomainStringNoclient.tt.omtrdc.netOverrides default hostname
secureBooleanNotrueUnset to enforce HTTP scheme
loggerObjectNoNOOP loggerReplaces the default NOOP logger
targetLocationHintStringNoNoneTarget location hint
fetchApiFunctionNoglobal.fetch or window.fetchfetch is used by the SDK for http requests. By default node-fetch or the browser implementation of fetch is used. But an alternative implementation can be provided using fetchApi
propertyTokenStringNoNoneTarget Property Token. If specified here, all getOffers calls will use this value. For on-device decisioning, the SDK will only download the artifact that contains the qualified activities for the property token set in propertyToken
decisioningMethodStringNoserver-sideDetermines which decisioning method to use (on-device, server-side, hybrid)
pollingIntervalNumberNo300000 (5 minutes)Polling interval for the on-device decisioning rule artifact (in milliseconds)
artifactLocationStringNoNoneA fully qualified url to the on-device decisioning rule artifact. Overrides internally determined location.
artifactPayloadObjectNoNoneThe JSON payload of the on-device decisioning rule artifact. If specified, it is used instead of requesting one from a URL.
eventsObject<String,Function>NoNoneAn optional object with event name keys and callback function values
telemetryEnabledBooleanNotrueWhen enabled, Adobe will collect SDK feature usage and performance telemetry data. Personal data is not collected.


Copied to your clipboard
1const CONFIG = {
2 client: "acmeclient",
3 organizationId: "1234567890@AdobeOrg",
4 events: {clientReady: targetClientReady }
7const targetClient = TargetClient.create(CONFIG);
9function targetClientReady() {
10 // 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.