@shop25/conversations
v1.2.1
Published
```js import { createWidget } from "@shop25/conversations";
Downloads
143
Readme
import { createWidget } from "@shop25/conversations";
const app = document.querySelector("#app");
if (!app) {
return;
}
const { client, destroy } = createWidget({
host: "https://conversations.s25.dev",
mountElement: app as HTMLElement,
orderName: "YP23648-1",
projectSlug: "yoshiparts.com",
});
client.on("mounted", () => console.log("mounted"));
client.on("customerSelected", (customerId) => console.log(customerId));
client.on("orderSelected", (orderName) => console.log(orderName));
setTimeout(() => {
client.emit("orderSelected", "YP23648-1");
}, 2000);
destroy()