Integrate APIs with your HTML Site without a Backend.
Tags: security, serverless, backend, api
Published: 2021-09-17 21:40:25


### Enrich your websites/apps with APIs; integrate them securely with only a couple of clicks.

![](https://cdn-images-1.medium.com/max/10944/1*VapNniGKyf_2yoKTnAwYRg.jpeg)

Have you ever wanted to connect API resources to your frontend but do not want to go through the hassle of programming a backend?

If you are a developer with an innovative idea that you want to implement quickly and securely but do not need/want to build a server-based backend; you can do that now in just minutes with KOR Connect. In this article I will walk you through how.

In this example we are going to create a website that calculates the exchange rate between two different currencies, and we will use the ‘Currency Exchange’ API from RapidAPI.

![Image 1](https://cdn-images-1.medium.com/max/2290/1*_BcWbAVpqFDYV5IfHN4K_Q.png)

We will need to acquire the following items:

1. The API key.
2. The name of the header where the API key will be received. For example RapidAPI uses the ‘x-rapidapi-key’ to receive the API Key.
3. The API URL.
4. Your website’s domain to allow the calls.

After getting these necessary items, go to korconnect.io and create your free account.

![Image 2](https://cdn-images-1.medium.com/max/2428/1*9KK8EIr9qZ2KUY67l7R_UQ.png)


Press the ‘+ CONNECT API’ button and fill in the required parameters such as the API Key, the Header Name, API URL, and the allowed host names from where the API will be called:

![Image 3](https://cdn-images-1.medium.com/max/2000/1*xfvEG5j4MC3o6cWc_ZIeVA.png)

Configure the 'Target API URL' as the domain name where your API is pointing to without any paths (for example: target.api.com). Your connection can be in 'Production Mode' or in 'Testing Mode' where you can test it from your own computer.

You will see your new API connection created.

![Image 4](https://cdn-images-1.medium.com/max/2658/1*iYiVj_lVuSDM0qSqLVo0UA.png)

Next, click on ‘View Details’ to see all of the specifics of your connection. Here you will find the 'Secure Base URL' that you can use to make calls to your API. You will only need to add the header 'x-api-key' with the key provided below, and you will be ready to make requests securely.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txhhxy9lnk0y002lgh1x.png)

The 'Single URL' provides basic protection for your connection, but if you want enhanced security for your API connection, you can implement it by clicking in the button 'Additional Security', and then switching the button that says 'Security Type: Single URL + Additional Security' in the upper right side of the screen. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5lq73opn4u30pr0raoy.jpg)

This option strengthens the security of your connection by adding reCaptcha functionalities. In order for your Frontend to get the additional functionalities, you will need to copy the code provided in the ‘Code Snippets’ below. You can select a snippet for HTML, REACT, VUE and ANGULAR frameworks. For this example we will use the code for HTML.

![Image 5](https://cdn-images-1.medium.com/max/2084/1*10jeg_L8T_lh9QqeLEnWpA.png)

We will need to exchange the APIs url to the one that KOR provides and append the path as it were the endpoint of the third party API. Now add the required URL params to request the exchange, for example: “ExchangeRates/exchange?from_currency=Param1&to_currency=Param2&q=Param3”. In our case we will send the currencies ISO 4217 codes that we would like to convert.

![Image 6](https://cdn-images-1.medium.com/max/2040/1*qah9aqunbthxqGKe8E8BYw.png)

Deploy your website, and that’s it! You no longer need to develop a backend to keep your API keys secure, just sign in to [https://korconnect.io](https://korconnect.io).

If you need a more technical explanation, you can check [https://kor-comunity.gitlab.io/kor-connect/](https://kor-comunity.gitlab.io/kor-connect/).