
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@livechat/helpdesk-sdk
Advanced tools
This SDK is a set of tools that will help you integrate your apps with the HelpDesk App.
For full documentation please head to Building HelpDesk apps.
The package can be installed directly from NPM.
npm install --save @livechat/helpdesk-sdk
The NPM package is distributed both as a CommonJS and ES6 module. It should be used together with a module bundler, such as Webpack or Rollup.
We also distrubute a UMD build of the package, which can be used directly in the browser.
<script src="https://unpkg.com/@livechat/helpdesk-sdk@1.0.3/dist/helpdesk-sdk.umd.min.js"></script>
Use one of the methods exported by the SDK.
createDetailsWidget(): Promise<IDetailsWidget>
Creates a widget instance to be used in the Ticket Details context.
import { createDetailsWidget } from ‘@livechat/helpdesk-sdk’;
createDetailsWidget().then(widget => {
// do something with the widget
});
createFullscreenWidget(): Promise<IFullscreenWidget>
Creates a widget instance to be used as a Fullscreen app.
import { createFullscreenWidget } from ‘@livechat/helpdesk-sdk’;
createFullscreenWidget().then(widget => {
// do something with the widget
});
IWidget
)All widgets share a common interface.
on(eventName: string, eventHandler: (data: any) => void): void
) - registers the event handler to be called when a given event occurs
off(eventName: string, eventHandler: (data: any) => void): void
) - unregisters the previously registered handler from the event
You can use it to track the events happening in the HelpDesk App.
import { createDetailsWidget } from ‘@livechat/helpdesk-sdk’;
createDetailsWidget().then(widget => {
function onTicketInfo(ticketInfo) {
// do something with the ticket info when it changes
}
// register when you need it
widget.on('ticket_info', onTicketInfo);
// ...
// unregister when you’re done
widget.off('ticket_info', onTicketInfo);
});
Each widget type offers a different set of events that you can listen to. Check them out in the descriptions below.
IDetailsWidget
)A type of widget that has access to the Chat Details context.
ticket_info
Emitted when user opens a ticket within Tickets. The handler will get the ticket info object as an argument:
interface ITicketInfo {
id: string;
shortId: string;
date: Date;
createdBy?: string;
updatedAt?: Date;
updatedBy?: string;
lastMessageAt?: Date;
events: any[];
requester: any;
status: any;
spam: any;
subject: string;
source: any;
tagIds: string[];
teamIds: string[];
assignment: any;
ratingRequestSent: boolean;
totalRatings: number;
rating?: any;
ccs?: any[];
draft?: any;
integrations?: any;
priority: any;
followers: string[];
childTickets: any[];
parentTicket: any;
customFields?: any;
}
getTicketInfo(): ITicketInfo | null
Gets the ticket info recorded most recently. Returns the ITicketInfo
object, which is identical to the one emitted by the ticket_info
event or null
.
modifySection(section): Promise<void>
With this method, you can modify any custom section declared in the widget's opening state in Developers Console. The section
argument should be an object implementing the section defintion interface, for example:
const section = {
title: ‘My section’,
components: [
// …
{
type: ‘button’,
data: {
label: ‘My section button’,
id: ‘section-button’
}
}
// …
]
};
widget.modifySection(section);
The title
of a given section has to match the one specified in the opening state. Otherwise, the section won't change. Also, the HelpDesk App ignores the commands without valid section definitions. Make sure that the definition you're sending is correct.
IFullscreenWidget
)This widget currently does not support any events.
setNotificationBadge(count: number | null): Promise<void>
Displays a red badge on top of the Fullscreen app icon. Use this to notify users there’s something important inside the widget. Make sure users can dismiss the notification to avoid cluttered UI.
Pull requests are welcome. For major changes, please open an issue first, so we can discuss what you would like to change. Follow a Contributing guide for more details.
The code and documentation in this project are released under the MIT License.
FAQs
SDK for extending HelpDesk App
We found that @livechat/helpdesk-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 70 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.