Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
/ server-proxy Public archive

Interact with Microlink API without exposing your credentials

License

Notifications You must be signed in to change notification settings

microlinkhq/server-proxy

Repository files navigation

microlink

Deploy with Vercel Deploy to Heroku

Interact with Microlink API without exposing your credentials.

NOTE: An Edge Proxy version is available.

Motivation

Interacting directly with Microlink API from frontend side is one of the most common scenarios.

However, it could be a risk security scenario if you are exposing your x-api-key, being possible that anyone can steal it and consume your API quota.

For preventing that, this tiny microservice allows you interact with Microlink API without compromising your credentials.

Usage

Deploy this microservice, setting up the necessaries environment variables.

After that, every time you need to interact with Microlink API, just call the microservice URL instead.

If you are using mql, setup it as endpoint parameter:

const mql = require('@microlink/mql')

mql('https://microlink.io', {
  endpoint: 'https://proxy.microlink.io'
})

Environment Variables

ORIGINS

Required
Type: string|string[]

The list of authorized origins to consume your Microlink API credentials.

They should be provided in the URL.origin format (e.g., 'https://example.com').

API_KEY

Required
Type: string

Your Microlink API key used to authenticate your requests.

API_ENDPOINT

Type: string
Default: https://pro.microlink.io

The Microlink API endpoint used for sending the requests.

License

proxy © Microlink, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

microlink.io · GitHub microlinkhq · Twitter @microlinkhq