Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

311
Views
Access to fetch at 'https://open-api.trovo.live/openplatform/channels/id' from origin 'http://localhost:3000

I am having a problem with fetching profile data from Trovo API.

Access to fetch at 'https://open-api.trovo.live/openplatform/channels/id' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.

In the documentation of the API says:

If you are making API calls from the client side, you may come across CORS issues. Your domain needs to be whitelisted in Trovo in order to do CORS calls.

In addition, please add origin in the header when you are making cross-site calls.

I am getting this error on production too, where I am using my registered domain.

const fetchProfile = async () => {
    const ress = await fetch(
      "https://open-api.trovo.live/openplatform/channels/id",
      {
        method: "POST",
        headers: {
          Accept: "application/json",
          "Client-ID": `${process.env.TROVO_CLIENT_ID}`,
          "Content-Type": "application/x-www-form-urlencoded",
        },
        body: '{"username":"test"}',
      }
    ).then((res) => res.json());
about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

You can make a proxy call.
On client side u can call :3000/trovo or something like this
And on server side make the call to the server

cli -> server -> trovo -> server -> cli

u encumber load on server, but u avoid cors

about 4 years ago · Santiago Gelvez Report

0

Your browser is stopping your local site calling any resource not on the same domain. In your package.json add the line:

proxy: "https://open-api.trovo.live";

and change your fetch call to be:

const ress = await fetch(
      "/openplatform/channels/id", ...

However, this will only work in dev and still may not work. I have not used Trovo so can't say exactly but in Sanity I have to go into the project settings and add all my domains in the CORS/Whitelist section which is what this is saying:

If you are making API calls from the client side, you may come across CORS issues. Your domain needs to be whitelisted in Trovo in order to do CORS calls.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!