跳到主要内容

Passing data to Deskpro

在 SDK Reference 中
作者列表
已发布: 2021年9月24日|最后更新: 2021年11月15日

Data may be passed to Deskpro via several methods of the SDK client, the data being passed depends on where the app is targeted, however gernerally the following data may be passed back to Deskpro:

import { createClient } from "@deskpro/horizon-apps-sdk"; // Create a Deskpro client instance using our SDK const client = createClient(); // Run the client after the page has loaded, so that a connection to Deskpro can be made after setup window.onload = () => client.run(); client.onReady((context) => { Deskpro.client.setBadgeCount(42); Deskpro.client.setTitle("App Title"); });
copy

The the above example, when the app is READY, we can use the Deskpro client to send data back to the wider system using several helper methods. In the example above, these are:

  • setBadgeCount(count: number) - Sets the badge count alongside the app icon

  • setTitle(title: string) - Sets the app title

These methods may be used only when the app is READY, so it's best to use them within the app event hooks themselves.

有帮助没有帮助
下一个页面Getting data from Deskpro

请登录或注册以提交评论。