連携 / 会員連携
連携 / 会員連携
会員連携
ログイン済みの顧客を対応に紐づけます。会員を連携すると、コンソールで顧客の名前・メールが表示され、コマース連携時には注文照会まで連動します。
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();