Socket
Socket
Sign inDemoInstall

@metahkg/api

Package Overview
Dependencies
9
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @metahkg/api

Access the metahkg api.


Version published
Maintainers
1
Created

Readme

Source

Metahkg Api

Client for the metahkg server. Generated with the openapi spec using nswag.

Regenerate

yarn generate

Install

yarn add @metahkg/api

Usage

Function names are based on operationIds.
For example, if the operationId is commentCreate, you can use api.commentCreate.

For operationIds of requests see api docs.

import { Client } from "@metahkg/api";

const axios = Axios.create();

axios.interceptors.request.use((config) => {
    const token = localStorage.getItem("token");
    if (token && config.headers) config.headers.Authorization = `Bearer ${token}`;
    return config;
});

axios.interceptors.response.use((response) => {
    if (response.headers.token) localStorage.setItem("token", response.headers.token);
    return response;
});

const api = new Client("https://dev.metahkg.org/api", axios);

api
  .thread(1)
  .then(console.log)
  .catch(console.error);

FAQs

Last updated on 17 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc