Overslaan naar hoofdinhoud

Getting data from Deskpro

in SDK Reference
Lijst van auteurs
Gepubliceeerd: 24 sep 2021|Laatst Gewijzigd: 15 sep 2022

During the lifecycle of an app, i.e. when the READY, SHOW and CHANGE events occur, data is passed via the event to the hook that you inmplement in your app code. We provide a core SDK for interacting with these events and basic usage is as follows.

import { createClient } from "@deskpro/app-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) => { // do something when the app is ready }); client.onShow((context) => { // do something when the app is shown to the user }); client.onChange((context) => { // do something when the "context" data has changed });
copy

In the above example you'll notice that a context object is passed via the associated event.

Fore a more in-depth guide on how to start building your first app, take a look at our how-to guides.

BehulpzaamNiet nuttig

0 van 2 mensen vonden deze pagina nuttig

vorige paginaPassing data to Deskpro

Log in of registreer om een reactie te plaatsen.