Hi everyone,
I need a bit of help with fetching data from my external backend in Forge. I’ve configured my manifest.yml
file to allow access to the external backend as follows:
external:
fetch:
backend:
- 1.something.somethingelse.cloud
- api.ipify.org
const BASE_URL = “https://1.something.somethingelse.cloud:16567/api”;
However, when I try to fetch data using Forge’s fetch
API, I receive a 403 error. Interestingly, if I don’t use Forge’s fetch and run it in tunnel mode, it works perfectly.
Here’s a snippet of my fetch function:
import { fetch } from '@forge/api';
const fetchData = async (endpoint) => {
const url = `${BASE_URL}/${endpoint}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
};
Issues:
Receiving a 403 error when using Forge’s fetch API.
Works only in tunnel mode if Forge’s fetch is not used.
Could anyone provide insights on why this might be happening and how to resolve the 403 error when using Forge’s fetch API?
Thank you in advance for your help!