The invokeRemote
bridge method enables apps to integrate with remote backends
hosted outside the Atlassian platform.
To use the invokeRemote
bridge method, you need to define an endpoint
for your back end in the manifest.yml
file.
1 2interface invokeRemoteInput { path: string; method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; headers?: Record<string, string>; body?: unknown; } function invokeRemote( input: InvokeRemoteInput ): Promise<{ [key: string]: any } | void>;
baseUrl
of the remote.Making a POST
request to a remote endpoint.
1 2import { invokeRemote } from "@forge/bridge"; invokeRemote({ method: 'POST', headers: { x-header-key: 'x-header-value', }, path: `/tasks/`, body: { description: 'Write docs', team: 'Forge', department: 'Ecosystem', } }).then((res) => console.log(`Created Task: ${JSON.stringify(res.task)}`));
Making a GET
request to a remote endpoint.
1 2import { invokeRemote } from "@forge/bridge"; invokeRemote({ method: 'GET', path: `/tasks/?team=Forge` }).then((res) => console.log(`Tasks: ${JSON.stringify(res.body[0])}`));
Rate this page: