Gå till huvudinnehåll

Passing data to Deskpro

i SDK Reference
Författarlista
Publicerad: 24 sep. 2021|Senast Uppdaterad: 15 nov. 2021

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.

HjälpfullOanvändbar
nästa sidaGetting data from Deskpro

Logga in eller registrera dig för att lämna en kommentar.