Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@noonahq/noona-hq-api

Package Overview
Dependencies
Maintainers
0
Versions
1954
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noonahq/noona-hq-api

This client uses [Orval](https://orval.com) to generate the client from noona-api's OpenAPI spec. It both exports Typescript interfaces and creates [React Query](https://react-query.tanstack.com) wrappers as well.

  • 0.0.3914
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
increased by196.45%
Maintainers
0
Weekly downloads
 
Created
Source

Noona Typescript Client

This client uses Orval to generate the client from noona-api's OpenAPI spec. It both exports Typescript interfaces and creates React Query wrappers as well.


Installation

yarn

yarn add @noonahq/noona-api-hq react-query

npm

(meteor) npm install --save @noonahq/noona-api-hq react-query

Install/update w.r.t. specific tag/branch

For each branch in the noona-api project, a NPM tag is published with it.

Example to install the package that correlates with the dev branch, use

yarn add @noonahq/noona-api-hq@dev

Setup

Configure axios

import axios from "axios";

axios.interceptors.request.use(async (config) => {
  const newConfig: AxiosRequestConfig = {
    ...config,
    baseURL: "https://api.noona.is",
    headers: {
      // Use HQ-ACCESS-KEY if Tímatal
      "NOONA-ACCESS-KEY": "XXX",
    },
  };

  return newConfig;
});

📘 The client package itself doesn't install axios. This is due to the fact that if the client also has axios installed, two instances are present and thus configuring it in your client won't work.


Configure react-query

Follow the quick start chapter in React Query's documentation, creating a QueryClient instance and wrap a QueryClientProvider around your application.

📘 Meteor + React + Blaze creates a new ReactDOM.render instance, resulting in Context values not being drilled down the DOM tree properly. The author of the library suggests wrapping every "level 3" React component with the provider - in our case, ReactQueryProvider. See the link for more details.


Usage

Interfaces

import { Company } from "@noonahq/noona-api-hq";

Queries

import { useListCompanies } from "@noonahq/noona-api-hq";

const { data, isLoading } = useListCompanies({
  company_type_id: companyTypeId,
  geolocation: {
    lat: location?.latLng?.lat ?? 0,
    lng: location?.latLng?.lng ?? 0,
  },
  sort_by: "popular",
});

const companies = data?.data;

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc