SDK 이벤트(Node.js)
마지막 업데이트: 2024년 7월 20일
- 주제:
- APIs/SDKs
작성 대상:
- 개발자
설명
SDK를 초기화할 때 options.events
개체는 이벤트 이름 키와 콜백 함수 값을 가진 선택적 개체입니다. SDK 내에서 발생하는 다양한 이벤트를 구독하는 데 사용할 수 있습니다. 예를 들어 clientReady
이벤트는 SDK에서 메서드 호출을 수행할 준비가 되었을 때 호출되는 콜백 함수와 함께 사용할 수 있습니다.
콜백 함수가 호출되면 이벤트 개체가 전달됩니다. 각 이벤트에는 이벤트 이름에 해당하는 type
이(가) 있습니다. 일부 이벤트에는 관련 정보가 포함된 추가 속성이 포함됩니다.
이벤트
이벤트 이름(유형) | 설명 | 추가 이벤트 속성 |
---|---|---|
clientReady | 아티팩트가 다운로드되고 SDK가 getOffers 호출을 위해 준비되면 내보내집니다. 온디바이스 의사 결정 방법을 사용할 때 권장됩니다. | |
artifactDownloadSucceeded | 새 아티팩트가 다운로드될 때마다 내보내집니다. | artifactPayload, artifactLocation |
artifactDownloadFailed | 아티팩트가 다운로드되지 않을 때마다 내보내집니다. | artifactLocation, 오류 |
예
Node.js
const targetClient = TargetClient.create({
client: "acmeclient",
organizationId: "1234567890@AdobeOrg",
decisioningMethod: "on-device",
events: {
clientReady: onTargetClientReady,
artifactDownloadSucceeded: onArtifactDownloadSucceeded,
artifactDownloadFailed: onArtifactDownloadFailed
}
});
function onTargetClientReady() {
// make getOffers requests
targetClient.getOffers({...})
}
function onArtifactDownloadSucceeded(event) {
console.log(`The artifact was successfully downloaded from '${event.artifactLocation}'`);
// optionally do something with event.artifactPayload, like persist it
}
function onArtifactDownloadFailed(event) {
console.log(`The artifact failed to download from '${event.artifactLocation}' with the following error message: ${event.error.message}`);
}
Target
- Adobe Target 개발자 안내서
- 시작
- 클라이언트측 구현
- 개요: 클라이언트측 웹용 Target 구현
- Adobe Experience Platform Web SDK 구현 개요
- at.js 구현
- at.js 개요
- at.js 작동 방식
- at.js를 배포하는 방법
- 온디바이스 의사 결정
- at.js 함수
- at.js 함수 개요
- adobe.target.getOffer()
- adobe.target.getOffers() - at.js 2.x
- adobe.target.applyOffer()
- adobe.target.applyOffers() - at.js 2.x
- adobe.target.triggerView() - at.js 2.x
- adobe.target.trackEvent()
- mboxCreate() - at.js 1.x
- targetGlobalSettings()
- mboxDefine() 및 mboxUpdate() - at.js 1.x
- targetPageParams()
- targetPageParamsAll()
- registerExtension() - at.js 1.x
- sendNotifications() - at.js 2.1
- at.js 사용자 지정 이벤트
- Adobe Experience Cloud Debugger를 사용하여 at.js 디버그
- Target에서 클라우드 기반 인스턴스 사용
- at.js FAQ
- at.js 버전 세부 사항
- at.js 1.x에서 at.js 2.x로 업그레이드
- at.js 쿠키
- 사용자 에이전트 및 클라이언트 힌트
- 글로벌 mbox 이해
- 서버 측 구현
- 하이브리드 구현
- Recommendations 구현
- 모바일 앱 구현
- 전자 메일 구현
- API 안내서
- 구현 패턴