Rate this page:
The web trigger runtime API can be used to programatically obtain web trigger URLs within your app.
Learn more about web triggers.
Import the Forge API package in your app, as follows:
1 2import { webTrigger } from "@forge/api";
Obtain the URL for the web trigger module specified by the given module key.
The web trigger URL is stable for each combination of:
For example, redeploying a new version of your app to the Forge production environment does not change the web trigger URL. However, the web trigger URL for the same app in the development environment is different.
1 2webTrigger.getUrl(moduleKey: string): Promise<string>;
In your manifest file, you'll need to have a web trigger module defined:
1 2modules: webtrigger: - key: example-web-trigger-key function: web-trigger-function function: - key: web-trigger-function handler: index.runWebTrigger
Obtain the URL for this web trigger within a function by specifying the web trigger module key:
1 2await webTrigger.getUrl("example-web-trigger-key");
Rate this page: