I’d like to know if I ought to use invokeRemote() from my resolver. I’m looking to data from a 3rd party site. No auth is required, it’s a simple GET to a public site (specifically, it’s fetching a list of public holidays, but that’s not important).
I was using fetch()
from @forge/api and it worked fine.
I thought, since I’ve declared a remote in my manifest (I think I need to do that so that whoever’s installing my app will be told that it’s going to get information from this 3rd party site, right?), I should use that. So I’m trying to replace fetch(new URL(3rdpartySite)....)
with invokeRemote(keyTo3rdPartySiteRemote, ...)
. However, I’m getting a HTTP 400 status code in my tunnel output, with the message ‘INVALID_REMOTE_ERR: Invalid remote key provided: keyTo3rdParthSiteRemote’ (though it is the correct remote key, I presume there’s a problem with it somehow).
So before I spend too much time digging into why this isn’t working… is it supposed to work like this? All the examples of invokeRemote seem to be much more complicated, requiring auth, endpoints, and a lot more YAML. It seems overkill for something I already had working in just a few lines of JS. Is “a simple GET from a simple site” one of the use-cases of invokeRemote
?