Skip to main content

Passing data to Deskpro

in SDK Reference
Authors list
Published: Sep 24, 2021|Last updated: Nov 15, 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.

HelpfulUnhelpful
next pageGetting data from Deskpro

Please log in or register to submit a comment.