@onboardbase/secure-fetch
v1.0.2
Published
fetch wrapper for Onboardbase's API gateway
Downloads
4
Keywords
Readme
Secret Fetch
fetch
wrapper for Onboardbase's API gateway.
Installation
yarn add @onboardbase/secure-fetch # npm i @onboardbase/secure-fetch
Usage
secure-fetch
proxies HTTP requests through Onboardbase's API gateway, allowing the use of Onboardbase's proxy API key feature without changing your codebase.
const secureFetch = require('secure-fetch');
const PROXY_API_KEY = "testsetestestest"
const res = await secureFetch('https://api.openai.com/v1/models', {
headers: {
'Authorization': `Bearer ${PROXY_API_KEY}`,
"Content-Type": "application/json"
}
}).then(res => res.json())