Blux Web sdk # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ################################################################################################################################################
安装
- 支持的节点.js版本
>= 10.24.1 - npm/yarn을 이용하여 설치하실.
// NPM 이용
npm install @blux.ai/web-sdk
// Yarn 이용
yarn add @blux.ai/web-sdk
初始化
- 필요:
Application ID, (中文(简体) ),API 키
const bluxClient = new BluxClient({
bluxApplicationId: "BLUX_APPLICATION_ID",
bluxAPIKey: "BLUX_API_KEY",
});
bluxClient.setLogLevel("warning");
- 设置日志级别 :================================================================================================================================================== (================================为================================ (========= {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢.
'debug''log''warning''error''fatal'
签名
- {\FN黑体\FS22\BORD1\SHAD0\3AHBE\4AH00\FSCX67\FSCY66\2CHFFFFFF\3CH808080}你觉得呢.
- 豪华서비스에서
UserId를. - {\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎么样.
- {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢
initialize{\fn华文仿宋\fs16\1cHD1D1D1}好.
bluxClient.signIn({ userId: "USER ID" });
用户收益
- {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢? 전화번호,이메일也.
bluxClient.setUserProperties({
userProperties: {
phone_number: "01011112222",
email_address: "[email protected]",
},
});
用户收益
setUserProperties{\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得呢.
bluxClient.setCustomUserProperties({
customUserProperties: {
custom_key1: "any_value",
custom_key2: true,
custom_key4: 3,
},
});
注册退出
- {\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得呢.
- {\fn华文仿宋\fs16\1cHD1D1D1}好.
bluxClient.signOut();
发送事件
{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢
:==================================================================================================================================================================================为======================== (===================================== (============.
bluxClient.sendEvent(
new AddProductDetailViewEvent({
itemId: "ITEM_ID",
}),
);
상품
======================================================================================================= ====================================================================================================================== (=============================== (.
bluxClient.sendEvent(
new AddLikeEvent({
itemId: "ITEM_ID",
}),
);
{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢
{\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎样.
bluxClient.sendEvent(
new AddCartaddEvent({
itemId: "ITEM_ID",
}),
);
상품
{\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得怎么样? {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}我付了钱.
bluxClient.sendEvent(
new AddOrderEvent({
orderId: "ORDER_ID",
paidAmount: 1200,
orderAmount: 2000,
items: [
{
id: "ITEM_ID_1",
price: 1000,
quantity: 1,
},
],
}),
);
// 복수 상품을 구매한 경우
bluxClient.sendEvent(
new AddOrderEvent({
orderId: "ORDER_ID",
paidAmount: 1200,
orderAmount: 2000,
items: [
{
id: "ITEM_ID_1",
price: 1000,
quantity: 1,
},
{
id: "ITEM_ID_2",
price: 2000,
quantity: 2,
},
],
}),
);