Forge functions recieve two arguments, a module specific payload and an object containing contextual information for the function invocation.
1 2export const handler = (payload, context) => { // Do something }
Functions implemented with @forge/resolver
resolver definitions receive arguments differently.
The payload is entirely module specific, for example a webtriggers request.
Context is the same for all modules.
1 2export type Context = { installContext: string; principal?: Principal; license?: License; installation?: Installation; workspaceId?: string; } export type Principal = { accountId: string; } export type License = { isActive: boolean; billingPeriod?: string | null; capabilitySet?: string | null; ccpEntitlementId?: string | null; ccpEntitlementSlug?: string | null; isEvaluation?: boolean | null; subscriptionEndDate?: string | null; supportEntitlementNumber?: string | null; trialEndDate?: string | null; type?: string | null; }; export type Installation = { ari: InstallationAri; contexts: ContextAri[]; } export type InstallationAri = { installationId: string; toString: () => string; }; export type ContextAri = { cloudId?: string; workspaceId?: string; toString: () => string; }
Property | Type | Description |
---|---|---|
principal | Principal | undefined | The principal containing the Atlassian ID of the user that interacted with the component. |
installContext | string | The ARI identifying the cloud or product context of this component installation. |
workspaceId | string | undefined | The ID of the workspace on which the extension is working. |
license | License | undefined | Contains information about the license of the app. This field is only present for paid apps in the production environment. license is undefined for free apps, apps in DEVELOPMENT and STAGING environments, and apps that are not listed on the Atlassian Marketplace. |
installation | Installation | undefined | A summary of the app installation, including the installation ARI and the contexts where the app is installed. |
Rate this page: