0.1.0-alpha.4 • Published 4 years ago
@userlike/messenger-types v0.1.0-alpha.4
Official Userlike Messenger API
This is currently in alpha state and is not suggested for production use.
Please be aware that during the alpha phase, there will be breaking changes without notice.
Install
npm install @userlike/messenger@internal
Usage
import { createMessenger } from "@userlike/messenger";
async function example() {
const result = await createMessenger({
version: 1,
widgetKey: "YOUR_WIDGET_SECRET",
});
if (result.kind === "error") throw new Error(result.error);
const { api } = result.value;
await api.mount();
}
API
interface Api {
/**
* Render the messenger.
*
* Messenger must not be mounted.
*/
mount(): Promise<...>;
/**
* Remove the messenger.
*
* Messenger must be mounted.
*/
unmount(): Promise<...>;
/**
* Clears contact session completely.
*/
logout(): Promise<...>;
/**
* Simulate as if the contact clicked the messenger button.
*
* This is a no-op if it's already maximized.
*/
maximize(): Promise<...>;
/**
* Set custom data.
*/
setCustomData(
data: Record<string, unknown>
): Promise<...>;
/**
* Set contact info.
*/
setContactInfo(data: {
name?: string;
email?: string;
}): Promise<...>;
}
0.1.0-alpha.4
4 years ago
0.1.0-alpha.3
4 years ago
0.0.1-alpha.16
4 years ago
0.1.0-alpha.0
4 years ago
0.1.0-internal.0
4 years ago
0.0.1-alpha.13
4 years ago
0.0.1-alpha.12
4 years ago
0.0.1-alpha.11
4 years ago
0.0.1-alpha.10
4 years ago
0.0.1-alpha.9
4 years ago
0.0.1-alpha.8
4 years ago
0.0.1-alpha.6
4 years ago
0.0.1-alpha.7
4 years ago
0.0.1-alpha.4
4 years ago
0.0.1-alpha.5
4 years ago
0.0.1-alpha.3
4 years ago
0.0.1-alpha.1
4 years ago