the open source API testing client for react
npm install @readyapi/api-client-react



``bash`
npm install @readyapi/api-client-react
`ts
import { ApiClientReact } from '@readyapi/api-client-react'
import React, { useState } from 'react'
export const Wrapper = () => {
const [isOpen, setIsOpen] = useState(false)
return (
<>
isOpen={isOpen}
request={{
url: 'https://api.sampleapis.com',
type: 'GET',
path: '/simpsons/products',
}}
/>
>
)
}
`
You will also need one of the following classes on a parent element:
`css`
.dark-mode
.light-mode
function to close the dialog, as seen above
boolean which controls the visibility of the dialog containing the client
`ts`
export type ClientRequestConfig = {
id?: string
name?: string
url: string
/* HTTP Request Method /
type: string
/* Request path /
path: string
/* Variables /
variables?: BaseParameter[]
/* Query parameters /
query?: Query[]
/* Cookies /
cookies?: Cookie[]
/* Request headers /
headers?: Header[]
/* Content type matched body /
body?: string
/* Optional form data body /
formData?: FormDataItem[]
}
We also export the base component if you do not want the modal.
ApiClientReactBase
Details on how to use it can be found in the source code for ApiClientReact`