연동 / 회원 연동

연동  /  회원 연동

회원 연동

로그인한 고객을 상담과 연결합니다. 회원을 연결하면 콘솔에서 고객 이름·이메일이 보이고, 커머스 연동 시 주문 조회까지 이어집니다.

init 시점에 로그인 상태라면

init config의 subscriberInfo로 회원 정보를 전달합니다.

account_idstring필수

회원 고유 ID — email과 둘 중 하나는 필수

emailstring옵션

회원 이메일 — account_id와 둘 중 하나는 필수

namestring옵션

고객 이름

phone_numberstring옵션

전화번호

external_user_idstring옵션

커머스 주문 연동 키 — 쇼핑몰 회원 ID와 일치해야 합니다

init 이후 로그인 / 로그아웃

SDK는 싱글턴이므로 재초기화 대신 커스텀 이벤트 lillo:userLoggedIn으로 로그인 상태를 전달합니다. 로그아웃은 lilloSDK.logout()을 호출합니다.

email 또는 account_id 중 하나는 반드시 필요합니다.

init 시 회원 연결
window.lilloSDK = window.LilloSDK.init({
  host: 'https://api.lillo.cx',
  chatAppUrl: 'https://chat.lillo.cx',
  clientKey: 'YOUR_CLIENT_KEY',
  subscriberInfo: {
    account_id: 'user-123',       // 필수(또는 email)
    email: 'user@example.com',
    name: '홍길동',
    phone_number: '01012345678',
    external_user_id: '123'       // 커머스 주문 연동 키
  }
});
init 이후 — 로그인 이벤트 / 로그아웃
// 로그인
window.dispatchEvent(new CustomEvent('lillo:userLoggedIn', {
  detail: { account_id: 'user-123', email: 'user@example.com', name: '홍길동' }
}));

// 로그아웃
window.lilloSDK.logout();