// After user logs in or data loadswindow.Asyntai = window.Asyntai || {};
window.Asyntai.userContext = {
"Customer name": currentUser.name,
"Email": currentUser.email,
"Subscription plan": currentUser.subscription.planName,
"Cart total": cart.total,
"Loyalty points": currentUser.loyaltyPoints
};
// You can update it anytime - changes apply to the next messagewindow.Asyntai.userContext["Cart total"] = newTotal;
채팅이 열릴 때만 사용자 데이터를 가져오세요 (성능에 최적):
// Define a function to fetch user contextwindow.Asyntai = window.Asyntai || {};
window.Asyntai.fetchUserContext = function() {
return fetch('/api/your-user-context-endpoint/')
.then(function(response) { return response.json(); })
.then(function(data) {
window.Asyntai.userContext = data;
});
};
// The widget automatically calls this when the chat opens
성능에 최적: 위젯이 fetchUserContext를 감지하고 채팅이 열릴 때 자동으로 호출하므로 필요할 때만 데이터가 로드됩니다.
공유할 내용은 직접 결정하세요. 사용 사례와 관련된 데이터만 전달하세요 - 고객 이름, 주문 상태, 구독 등급, 장바구니 내용 또는 AI가 사용자를 더 잘 지원하는 데 도움이 되는 기타 정보. AI가 컨텍스트를 이해할 수 있도록 설명적인 레이블을 사용하세요.
활용 사례
이커머스
"주문 #4521이 현재 배송 중이며 금요일까지 도착할 예정입니다."
SaaS
"Pro 플랜에서 이번 달 847개의 API 호출이 남아 있습니다."
지원
"Gold 회원이시고 3개의 열린 티켓이 있군요. 어떻게 도와드릴까요?"
교육
"You're 78% through the JavaScript course. Ready to start Module 8?"
숙박
"9월 17일 예약이 확인되었습니다. 체크인은 오후 3시부터입니다."
의료
"Dr. Smith와의 다음 예약은 화요일 오전 10시로 예정되어 있습니다."
중요 사항
선택사항 - 채팅은 사용자 컨텍스트 없이도 완벽하게 작동합니다. 로그인한 사용자를 위한 향상 기능입니다.
실시간 - 컨텍스트는 각 메시지와 함께 전송되므로 사용자 데이터가 변경될 때 동적으로 업데이트할 수 있습니다.
보안 - 비밀번호, 신용카드 번호 또는 기타 민감한 데이터를 절대 포함하지 마세요. 민감하지 않은 정보만 전달하세요.
크기 제한 - 사용자 컨텍스트는 Standard에서 2,000자, Pro에서 10,000자로 제한됩니다. 초과하면 맞도록 잘립니다. 컨텍스트를 간결하게 유지하세요.
접근 제어가 아닙니다 - User context is set by your page in the visitor's browser, so it must never be what stands between a visitor and restricted content. To restrict which knowledge items a visitor can retrieve at all, use Access Tags (Enterprise) — enforced on our servers with a claim signed by your own back end.
통합 상태
After implementing, visit the User Context settings page to verify your integration is working. The status card will show:
컨텍스트가 수신되고 있는지 여부
컨텍스트가 포함된 최신 메시지
전송 중인 컨텍스트 데이터 미리보기
Platform Guides
Using a specific CMS or e-commerce platform? We have step-by-step setup instructions for each — pick yours below to jump straight to the guide.