Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@channel.io/channel-web-sdk-loader

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@channel.io/channel-web-sdk-loader - npm Package Compare versions

Comparing version 1.1.7 to 2.0.0

33

dist/index.cjs.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setAppearance = exports.hideChannelButton = exports.showChannelButton = exports.resetPage = exports.setPage = exports.removeTags = exports.addTags = exports.updateUser = exports.clearCallbacks = exports.onUrlClicked = exports.onFollowUpChanged = exports.onChatCreated = exports.onBadgeChanged = exports.onHideMessenger = exports.onShowMessenger = exports.track = exports.openSupportBot = exports.openChat = exports.hideMessenger = exports.showMessenger = exports.shutdown = exports.boot = exports.loadScript = void 0;
exports.setAppearance = exports.hideChannelButton = exports.showChannelButton = exports.resetPage = exports.setPage = exports.removeTags = exports.addTags = exports.updateUser = exports.clearCallbacks = exports.onUrlClicked = exports.onFollowUpChanged = exports.onChatCreated = exports.onBadgeChanged = exports.onHideMessenger = exports.onShowMessenger = exports.track = exports.openWorkflow = exports.openChat = exports.hideMessenger = exports.showMessenger = exports.shutdown = exports.boot = exports.loadScript = void 0;
const isSSR = () => {

@@ -116,3 +116,3 @@ if (typeof window === 'undefined') {

* - Reveals the `messenger` if hidden.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The support bot initializes if active.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The workflow initializes if active.
* - If a chat with the given `chatId` exists, the chat will open, and the `message` parameter will be disregarded.

@@ -131,19 +131,17 @@ * - If no matching chat exists, the `home` view opens.

/**
* Initiates a chat by triggering a specified support bot.
* Initiates a chat by triggering a specified workflow.
*
* - Reveals the `messenger` if hidden.
* - Activates the support bot identified by the given `supportBotId`.
* - No action is taken if `supportBotId` is not specified.
* - Shows an error page if a support bot with the specified `supportBotId` does not exist.
* - Populates the chat input with `message` upon support bot completion if provided.
* - Activates the workflow identified by the given `workflowId`.
* - No action is taken if `workflowId` is not specified.
* - Shows an error page if a workflow with the specified `workflowId` does not exist.
* - Caution: Utilizing this function outside a click event may cause issues in iOS Safari.
*
* @param {string} supportBotId - Identifier of the targeted support bot.
* @param {string | undefined} message - Optional message to populate the chat input field post support bot action.
* @see https://developers.channel.io/docs/web-channelio#opensupportbot
* @param {string} workflowId - Identifier of the targeted workflow.
* @see https://developers.channel.io/docs/web-channelio#openworkflow
*/
function openSupportBot(supportBotId, message) {
safeChannelIO('openSupportBot', supportBotId, message);
function openWorkflow(workflowId) {
safeChannelIO('openWorkflow', workflowId);
}
exports.openSupportBot = openSupportBot;
exports.openWorkflow = openWorkflow;
/**

@@ -259,5 +257,6 @@ * Tracks user event.

/**
* Sets the current page.
* Sets the current page and user chat profile.
* - Page can be used instead of canonical URL.
* @param {string} page - The page to set. Do not pass null or undefined. Use `resetPage` to clear.
* @param {Record<string, any>} profile - The user chat profile value.
* @see [ChannelIO: setpage API](https://developers.channel.io/docs/web-channelio#setpage)

@@ -267,8 +266,8 @@ * @see [page Glossary](https://developers.channel.io/docs/page)

*/
function setPage(page) {
safeChannelIO('setPage', page);
function setPage(page, profile) {
safeChannelIO('setPage', page, profile);
}
exports.setPage = setPage;
/**
* - Reset the page value.
* - Reset the page and user chat profile value.
* - If you use resetPage, a canonical URL is used as the page value.

@@ -275,0 +274,0 @@ * @see [ChannelIO: resetpage API](https://developers.channel.io/docs/web-channelio#resetpage)

@@ -240,3 +240,3 @@ declare global {

* - Reveals the `messenger` if hidden.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The support bot initializes if active.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The workflow initializes if active.
* - If a chat with the given `chatId` exists, the chat will open, and the `message` parameter will be disregarded.

@@ -252,16 +252,14 @@ * - If no matching chat exists, the `home` view opens.

/**
* Initiates a chat by triggering a specified support bot.
* Initiates a chat by triggering a specified workflow.
*
* - Reveals the `messenger` if hidden.
* - Activates the support bot identified by the given `supportBotId`.
* - No action is taken if `supportBotId` is not specified.
* - Shows an error page if a support bot with the specified `supportBotId` does not exist.
* - Populates the chat input with `message` upon support bot completion if provided.
* - Activates the workflow identified by the given `workflowId`.
* - No action is taken if `workflowId` is not specified.
* - Shows an error page if a workflow with the specified `workflowId` does not exist.
* - Caution: Utilizing this function outside a click event may cause issues in iOS Safari.
*
* @param {string} supportBotId - Identifier of the targeted support bot.
* @param {string | undefined} message - Optional message to populate the chat input field post support bot action.
* @see https://developers.channel.io/docs/web-channelio#opensupportbot
* @param {string} workflowId - Identifier of the targeted workflow.
* @see https://developers.channel.io/docs/web-channelio#openworkflow
*/
export declare function openSupportBot(supportBotId: string, message?: string): void;
export declare function openWorkflow(workflowId: string): void;
export interface EventProperty {

@@ -411,5 +409,6 @@ [key: string]: string | number | boolean | null;

/**
* Sets the current page.
* Sets the current page and user chat profile.
* - Page can be used instead of canonical URL.
* @param {string} page - The page to set. Do not pass null or undefined. Use `resetPage` to clear.
* @param {Record<string, any>} profile - The user chat profile value.
* @see [ChannelIO: setpage API](https://developers.channel.io/docs/web-channelio#setpage)

@@ -419,5 +418,5 @@ * @see [page Glossary](https://developers.channel.io/docs/page)

*/
export declare function setPage(page: string): void;
export declare function setPage(page: string, profile?: Record<string, any>): void;
/**
* - Reset the page value.
* - Reset the page and user chat profile value.
* - If you use resetPage, a canonical URL is used as the page value.

@@ -424,0 +423,0 @@ * @see [ChannelIO: resetpage API](https://developers.channel.io/docs/web-channelio#resetpage)

@@ -108,3 +108,3 @@ const isSSR = () => {

* - Reveals the `messenger` if hidden.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The support bot initializes if active.
* - For an undefined `chatId`, a new chat is created. Any provided `message` populates the chat input. The workflow initializes if active.
* - If a chat with the given `chatId` exists, the chat will open, and the `message` parameter will be disregarded.

@@ -122,17 +122,15 @@ * - If no matching chat exists, the `home` view opens.

/**
* Initiates a chat by triggering a specified support bot.
* Initiates a chat by triggering a specified workflow.
*
* - Reveals the `messenger` if hidden.
* - Activates the support bot identified by the given `supportBotId`.
* - No action is taken if `supportBotId` is not specified.
* - Shows an error page if a support bot with the specified `supportBotId` does not exist.
* - Populates the chat input with `message` upon support bot completion if provided.
* - Activates the workflow identified by the given `workflowId`.
* - No action is taken if `workflowId` is not specified.
* - Shows an error page if a workflow with the specified `workflowId` does not exist.
* - Caution: Utilizing this function outside a click event may cause issues in iOS Safari.
*
* @param {string} supportBotId - Identifier of the targeted support bot.
* @param {string | undefined} message - Optional message to populate the chat input field post support bot action.
* @see https://developers.channel.io/docs/web-channelio#opensupportbot
* @param {string} workflowId - Identifier of the targeted workflow.
* @see https://developers.channel.io/docs/web-channelio#openworkflow
*/
export function openSupportBot(supportBotId, message) {
safeChannelIO('openSupportBot', supportBotId, message);
export function openWorkflow(workflowId) {
safeChannelIO('openWorkflow', workflowId);
}

@@ -238,5 +236,6 @@ /**

/**
* Sets the current page.
* Sets the current page and user chat profile.
* - Page can be used instead of canonical URL.
* @param {string} page - The page to set. Do not pass null or undefined. Use `resetPage` to clear.
* @param {Record<string, any>} profile - The user chat profile value.
* @see [ChannelIO: setpage API](https://developers.channel.io/docs/web-channelio#setpage)

@@ -246,7 +245,7 @@ * @see [page Glossary](https://developers.channel.io/docs/page)

*/
export function setPage(page) {
safeChannelIO('setPage', page);
export function setPage(page, profile) {
safeChannelIO('setPage', page, profile);
}
/**
* - Reset the page value.
* - Reset the page and user chat profile value.
* - If you use resetPage, a canonical URL is used as the page value.

@@ -253,0 +252,0 @@ * @see [ChannelIO: resetpage API](https://developers.channel.io/docs/web-channelio#resetpage)

{
"name": "@channel.io/channel-web-sdk-loader",
"version": "1.1.7",
"version": "2.0.0",
"description": "Official Channel Web SDK Loader",

@@ -5,0 +5,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc