Skip to content

Commit

Permalink
v10.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Apr 11, 2023
1 parent 37cd037 commit 688c712
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Gleap = window.Gleap;

Gleap.setFrameUrl("http://0.0.0.0:3001");
Gleap.setApiUrl("http://0.0.0.0:9000");
Gleap.initialize("dEZmeezQWkKq2sgaBxtDj8Gk9FMfQsPq");
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
//Gleap.setEnvironment("dev");

/*Gleap.setUrlHandler((url, newTab) => {
Expand Down
9 changes: 7 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export namespace Gleap {
replays: Boolean;
}
): void;
function startBot(botId: string, showBackButton?: boolean): void;
function attachCustomData(customData: any): void;
function setCustomData(key: string, value: string): void;
function removeCustomData(key: string): void;
Expand Down Expand Up @@ -70,7 +71,9 @@ export namespace Gleap {
function attachNetworkLogs(networkLogs: string): void;
function clearIdentity(): void;
function setTags(tags: string[]): void;
function setDisableInAppNotifications(disableInAppNotifications: boolean): void;
function setDisableInAppNotifications(
disableInAppNotifications: boolean
): void;
function identify(
userId: string,
customerData: {
Expand All @@ -91,7 +94,9 @@ export namespace Gleap {
shareToken?: string,
showBackButton?: boolean
): void;
function setUrlHandler(urlHandler: (url: string, newTab?: boolean) => void): void;
function setUrlHandler(
urlHandler: (url: string, newTab?: boolean) => void
): void;
function openHelpCenter(showBackButton?: boolean): void;
function openHelpCenterCollection(
collectionId: string,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "10.0.0",
"version": "10.0.3",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/10.0.3/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,30 @@ class Gleap {
GleapFrameManager.getInstance().showWidget();
}

/**
* Starts a new conversation and attaches the bot with the given id.
*/
static startBot(botId, showBackButton = true) {
if (!botId) {
return;
}

GleapFrameManager.getInstance().setAppMode("widget");

GleapFrameManager.getInstance().sendMessage(
{
name: "start-bot",
data: {
botId,
hideBackButton: !showBackButton,
},
},
true
);

GleapFrameManager.getInstance().showWidget();
}

/**
* Opens a help center collection
*/
Expand Down

0 comments on commit 688c712

Please sign in to comment.