@nbn23/secure-request
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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
});

Readme

Keywords

Package Sidebar

Install

npm i @nbn23/secure-request

Weekly Downloads

170

Version

1.1.2

License

ISC

Unpacked Size

13.9 kB

Total Files

10

Last publish

Collaborators

  • nbn
  • maraat