Preskoči in pojdi v glavno vsebino

Developer Mode

v Apps
Seznam avtorjev
Objavljeno: 1. feb. 2022|Nazadnje Posodobljeno: 28. sep. 2022

When developing an app, it is necessary to do so "in place". During an app's lifecycle it receives events and data, as well as signals from other parts of deskpro via target actions. Your app will also need to send commands to Dekspro to store state and entity associations as well as set app elements and properties of the target. As such, it is best to develop your app whilst it is connected to Deskpro.

To facilitate this, there's a setting in the app manifest that activates "developer mode". Developer mode allows you to specify an alternative entrypoint for each of your app targets so you can point your target at a development server.

Enabling Developer ModeCopy link to Enabling Developer Mode to clipboard

To use developer mode you must first add the hasDevMode flag to your app manifest. This flag MUST be removed before your app is finally published.

# /manifest.json { "name": "my_app", "title": "My App", "description": "Brief description of my app", "version": "1.0.0", "scope": "agent", "isSingleInstall": true, "hasDevMode": true, "targets": [{ "target": "ticket_sidebar", "entrypoint": "index.html" } }] }
copy

Once you've added the flag to your app manifest, build and package your app then upload it to your available apps in Deskpro admin.

Install your app, then click on the installed app to update it. You should then see the "Developer Mode" tab:

image.png

Enter your development server's URL your your app target(s) and click "Save". You can then reload your app in the agent interface by hard refreshing Deskpro. Your app will now be using your development server as the endpoint so you can benefit from features like hot module replacement to get realtime dev updates.

Warning: it is important to remove the hasDevMode flag from your manifest before publishing your app.

Note

If you're using Google Chrome's dev tools you may need to switch the level at which log entries are shown. As the app is displayed in an iframe, and is coming from a different host/origin, when using dev mode it's necessary to change the level from "top" to "localhost"

UporabnoNeuporabno
naslednja stranApp Events
Prejšnja stranApp Settings

Pred objavo komentarja se moraš prijaviti.