valerii.f
AAlokai
•Created by valerii.f on 1/15/2024 in #🙋|general-help
SDK error handling
Hello 👋
We have our custom integration, using REST API.
Endpoint example:
SDK folder:
API Client folder:
Using integration with Next.js application.
when calling this endpoint fails, getting eror:
What am I missing, how/where should we properly handle errors with integration ?
Thanks!
43 replies
AAlokai
•Created by valerii.f on 12/20/2023 in #🙋|general-help
Deploy Vuestorefront with Docker
Hi community,
I am trying to understand the deployment part.
So I have a vuestorefron application running React/Next.js
I have a vuestorefront integration with (custom)
When I connected React/Next.js with integration - locally, the integration server is running on the
http://localhost:8181/
when in React/Next.js app I call sdk.customIntegration.generateCustomerToken(payload)
- I can see in Chrome Devtools that it does POST request to an endpoint http://localhost:8181/customIntegration/generateCustomerToken
So now I am ready to deploy this application LIVE,
when I deploy React/Next.js application - it can be accessed on some specific domain let's say mysite.com
when I deploy a middleware application - I should also expose it to the world on a specific domain let's say api.mysite.com
I can't understand what should I configure in the React/Next.js application during build
time, so that when the application calls SDK sdk.customIntegration.generateCustomerToken(payload)
- it does POST request to
http://api.mysite.com/customIntegration/generateCustomerToken
Could you please help me with that ?
Or maybe I am doing something wrong ?
Thank you!6 replies
AAlokai
•Created by valerii.f on 11/20/2023 in #🙋|general-help
Problems using Custom Integration
Hello!
I am writing custom integration using boilerplate
npx @vue-storefront/cli create integration
everything configured as per documentation, added endpoints - and it works fine with playground
🙂
And now I want to use it to connect to some demo application based on https://github.com/vuestorefront/storefront-next13-boilerplate/tree/develop
And i need help here, it seems I am missing something, which doesn't let me start the middleware.
Here is what I did so far.
I built the middleware sdk: inside integration application -> packages/sdk -> run yarn build
as a result I got the lib
folder, which I copy into my Next.js application
In the Next.js application I updated middleware.config.js
with configuration
and location: '@vue-storefront/integration-boilerplate-api/server'
-> which looks weird to me, but that is another question.
when trying to run middleware application getting error:
Could you please help me to understand what exactly am I doing wrong ? 🥹 🙏9 replies