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

@scalar/api-client-react

Package Overview
Dependencies
Maintainers
0
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/api-client-react

the open source API testing client for react

  • 1.1.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1K
increased by63.78%
Maintainers
0
Weekly downloads
 
Created
Source

Scalar API Client React

Version Downloads License Discord

Installation

npm install @scalar/api-client-react

Compatibility

This package is compatible with React 19 and is untested on React 18. If you want guaranteed React 18 support please use version 1.0.107 of this package.

Usage

First we need to add the provider, you should add it in the highest place you have a unique spec.

import { ApiClientModalProvider } from '@scalar/api-client-react'
import '@scalar/api-client-react/style.css'

;<ApiClientModalProvider
  configuration={{
    spec: {
      url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
    },
  }}>
  {children}
</ApiClientModalProvider>

Then you can trigger it from anywhere inside of that provider by calling the useApiClientModal()

import { useApiClientModal } from '@scalar/api-client-react'

const client = useApiClientModal()

return (
  <button
    onClick={() => client?.open({ path: '/auth/token', method: 'get' })}>
    Click me to open the Api Client
  </button>
)

Check out the playground for a working example.

Community

We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar

License

The source code in this repository is licensed under MIT.

Keywords

FAQs

Package last updated on 20 Jan 2025

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