

Carlos Solís
Consume APIs with the Modyo SDK in your JavaScript app
Learn how to easily integrate Modyo’s headless API into your JavaScript app using its SDK. Follow a step-by-step guide with a React example for seamless consumption.
In Modyo we have four ways to load a JS library.
The first and least recommended is to load the libraries directly from the CDN where they are hosted.
In Modyo Platform, in your Site, go to Templates, we open the head Snippet and load the libraries with the script tag.
This is the best option when loading libraries that we will use throughout the site, for this we are going to create a new snippet with the name of the library you want to add, if we type _js or _css as part of the name, our editor will set the correct syntax and will help with Autocomplete.
Then we paste the code from the library.
Then we paste the snippet code into the base stylesheet of our site.
This is very similar to the previous example, but now we will load the snippet inside a widget, so that it is only loaded when this widget is called.
If you have a site where you need many pages to load these libraries, it is best to generate different Layouts and add those layouts individually to the corresponding pages.
For this, inside Modyo Platform, go to Templates, click + to add a new Layout. Type a name that will identify the new Layout.
Then, create a new JS file by clicking the + next to the JavaScript section and inside this new file, paste the snippet from the library. (you can paste it directly or you can also paste it as a snippet).
Finally, we return to the layout 'Vue' and paste the code of the JS sheet below the head. Click Save and Publish your Layout.
Now you can apply this Layout to your pages. Go to a page and in its properties, you can now see and apply the new Layout.
Photo by James Harrison on Unsplash.
Carlos Solís
Learn how to easily integrate Modyo’s headless API into your JavaScript app using its SDK. Follow a step-by-step guide with a React example for seamless consumption.
Carlos Solís
In a digital environment where threats are constant, ensuring the security of websites is essential. One of the best ways to protect your applications is through Security Headers, HTTP configurations that act as protective barriers against attacks
Carlos Solís
Learn how Domain Driven Design (DDD) empowers you to build applications that align with your business. Apply DDD in microservices and micro frontends architectures to create scalable,and maintainable solutions,leveraging the power of Modyo.