@iqrf/iqrf-repository-client
v0.1.4
Published
IQRF Repository JavaScript client library
Downloads
302
Readme
IQRF Repository JavaScript client
Installation
npm install @iqrf/iqrf-repository-client
How to use
Client is a wrapper around API methods of IQRF Repository providing shared configuration for Axios instance.
Instantiate with defaults
import { Client } from '@iqrf/iqrf-repository-client';
const client = new Client();
Instantiate with custom configuration
import { Client } from '@iqrf/iqrf-repository-client';
const config: AxiosRequestConfig = {
baseURL: 'https://devrepo.iqrfalliance.org/api/',
};
const client = new Client({ config });
Instantiate with custom Axios instance advanced
import axios, { type AxiosRequestConfig } from 'axios';
import { Client } from '@iqrf/iqrf-repository-client';
const config: AxiosRequestConfig = {
baseURL: 'https://repository.iqrfalliance.org/api/',
};
const axiosInstance = axios.create(config);
const client = new Client({ axiosInstance });