@nbn23/secure-request
v1.1.2
Published
Secure request library
Downloads
365
Readme
Secure request
This is a tiny utility to make secure HTTP calls. Additionaly it has a small utility to make GraphQL calls easily. The library is responsible for managing authentication to secured calls based on Google JWT.
Getting Started
Install secure-request using npm.
npm install --save @nbn23/secure-request
Note: secure-request assumes a TypeScript environment but it can be use in vanilla javascript.
Usage
HTTP calls
const request = await Request.init();
const { data } = await request.get<boolean>(url);
GraphQL calls
const request = await GraphQLRequest.init();
const { test } = await request.call<"test", boolean>({
url,
query,
variables
});