Making API requests to third party URLs

Your UI App always runs within the context of Gtmhub account. The Gtmhub platform uses multiple security mechanisms which might interfere with your UI App when you are making request to a 3rd party URL. The UI Apps SDK enables you to make such requests via the request method.

NOTE: Before you start using the SDK methods, ensure you have imported and configured the SDK first.


To make a request to a third party URL within your UI app, use the request method from the Gtmhub SDK. For example:

import gtmhub from "@gtmhub/sdk";

const sdk = initializeSdk({
  pluginId: "my-plugin-id"

    method: "GET",
    url: "",
    params: {
      sort: "descending",
      limit: 100,
    headers: {
      "Authorization": `Bearer ${token}`,
      "gtmhub-accountId": `${accountId}`,
      "Accept": "application/json",
  .then((users) => console.log(users))
  .catch((error) => handleUiError(error));