The requestRemote bridge method allows Forge apps to make direct requests to remote backends from UI Kit and Custom UI applications. This method is optimized for latency-sensitive requests that affect user experience and don't require OAuth tokens. The method returns a standard WHATWG fetch Response object.
Unlike invokeRemote, requests made with requestRemote are not treated as official invocations and are not proxied through the Forge platform. This means requestRemote will not include OAuth tokens, even if configured for the remote, and will not be reflected in invocation metrics in the Developer console.
Similar to invokeRemote, requests include a Forge Invocation Token (FIT) as a bearer token in the authorization header. The FIT is a JWT that contains key information about the invocation context, signed into the claims.
Keeping your remote app secure Your remote backend must validate the FIT to confirm the request originates from Atlassian. You must also verify the contextual claims to ensure the operations performed by your service suit the request context. See Verifying Remote Requests for more details on how to validate the FIT.
You may choose to use requestRemote over invokeRemote for latency sensitive applications, which directly impacts user experience and you don't need OAuth tokens for Atlassian API calls.
1 2type RequestRemoteOptions = { path: string; }; function requestRemote( remoteKey: string, options?: RequestRemoteOptions & RequestInit, ): Promise<Response>
manifest.yml file.https://api.example.com and path is /users/123, the final URL becomes https://api.example.com/users/123method, headers and body, but does not not support signalMaking a POST request to a remote endpoint:
1 2import { requestRemote } from '@forge/bridge'; const response = await requestRemote('my-remote-key', { path: `/tasks/?team=Forge`, method: 'POST', headers: { 'Content-Type': 'application/json', 'custom-header': 'custome-value' }, body: JSON.stringify({ taskName: 'My cool Forge task' }) }); if (!response.ok) { throw new Error(`request failed with the following status code: ${response.status}`); }
Making a GET request to a remote endpoint
1 2import { requestRemote } from '@forge/bridge'; const response = await requestRemote('my-remote-key', { path: `/tasks/?team=Forge`, method: 'GET', headers: { 'custom-header': 'custome-value' }, }); if (!response.ok) { throw new Error(`request failed with the following status code: ${response.status}`); }
FormData is currently not supported. Please follow the Forge changelog for updates.principal and app.license fields in the claims. We intend to add these, please follow the Forge changelog for updates.invokeRemote, OAuth tokens are not included in requests. If you require them to be delievered on invocation, please use invokeRemote instead.Rate this page: