About intents
- Concept
- 5 minutes
The intents mechanism is one way to extend an app's functionality. An intent is a message object you define in an app that allows you to pass the user flow from one app to another. We've many reasons for sending intents. For example:
- Share a chart with the Dashboard app
- Show details of an app based on the
appId
- Create a new JIRA ticket and get the ticket ID
Lifecycle of an intent
There are three elements involved in the intent mechanism:
- Source app: Sends an intent to another app
- Target app: Receives the intent and acts on the intent
- AppShell: Handles the communication between the source and the target app.
Here is what happens when a source app sends an intent:
-
The source app sends the request to AppShell, for example, using the
sendIntent
method from@dynatrace-sdk/navigation
. The communication uses thewindow.postMessage
API. -
The AppShell allows users to select an app from a list of apps that can handle the intent.
-
The AppShell opens the target app in an iframe and passes the intent as query arguments in the URL.
-
The target app can perform any action on the received intent.