Why Am I Experiencing CORS Errors When Using the 'Get Deployed Trigger' Endpoint in Pipedream's Typescript Browser SDK?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, I get CORS errors when using the Get deployed trigger endpoint, but not with any other endpoints (for the same token). Anyone know why this might be? I’m using the Typescript browser SDK.

To make sure I’m using the correct token I’ve even tried making the call immediately after deploying a trigger, and I get the same issue.

If you faced CORS error, you might want to move the API call to your server side

Yeah, I could ask our backend team to add an endpoint to proxy this call through the server, but it leads to a disjointed experience (with a subset of calls being proxied).

This feels like a bug with the Connect API? I raised in here because I’m not sure if there’s something we should be doing differently during the token generation process to avoid this, or to ask if this endpoint is intentionally unavailable from a browser.

Hey ,

You’re getting a CORS error because the Pipedream Connect API is designed to be used in a server-side environment (like Node.js), not directly in a web browser.

The problem is a fundamental browser security feature called the Cross-Origin Resource Sharing (CORS) policy. It prevents a script on your website from making requests to a different domain (like Pipedream’s API) unless that domain explicitly allows it.

Given this context, I would recommend you to move all Pipedream Connect API calls to your backend server.

If that’s the case then why does the Typescript SDK provide a browser client?

All the other connect API calls work perfectly fine when using the provided browser client, it’s just this one that fails.

Yea in theory you should be able to make the call from the browser, if that’s the only endpoint that’s giving you a CORS error I do agree it sounds like a bug, will check it out.

Thanks!

Hey do you know if anyone has had a chance to look at this yet? I can raise via the support email address if it’s easier to track that way.

Can you create a bug in GitHub issues? Will get it on my team’s radar after that.

Thanks Danny, I’ve just raised a bug - [BUG] CORS errors when sending requests to `GET /deployed-triggers/{trigger_id}` · Issue #18816 · PipedreamHQ/pipedream · GitHub