How to use my own API in a react app?

Hey everyone!

I’m developing an app integration to connect to my company’s augmented reality services to a store. The app is ready in it’s first state and now we’re thinking about publishing it in the VTEX App Store.

We have our own API services and I was reading the engineering guidelines before submitting and it says that we need to use the VTEX IO Clients, which I think I understand now, but I don’t know how to make those calls from React or how to communicate the Node module with React.

Is there any guide or tutorial I can follow? I can’t find the exact information I need.

For now I’m just using axios to handle all the requests I need in React.

Hola Matias,

The last message in this topic might help you.

Saludos

1 Like

Hola @Saito,

I think I found my answer in that thread, this tutorial is what I was looking for. I’m trying that solution now.

I’m getting this error following that tutorial though:

error: node@4.x builder failed to install dependencies through yarn (retries=0)
yarn errors:
graphql@16.6.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0". Got "12.16.1"
Found incompatible module. vtex.builder-hub@0.285.4

But I think that might be an issue for another thread, so once I figure it out what is going on I’ll close this one.

So thanks for the answer!

Hola Matias,

Maybe this thread might help you.

I found the same thread and that solution didn’t work for me. I’m looking for similar posts to see if I can find the answer.

Thanks!

I forgot to close this, but I found a way to use my own API. Sometimes it’s hard to find tutorials related to VTEX apps but I’ll list the resources that helped me here:

About the error I mentioned before about the Node Builder and the version compatibility I just needed to create a service.json file with this inside:

{
  "memory": 256,
  "timeout": 2,
  "minReplicas": 2,
  "maxReplicas": 4
}

Thanks to @Saito for the help!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.