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

@stakekit/api-hooks

Package Overview
Dependencies
Maintainers
0
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stakekit/api-hooks

React hooks for StakeKit API

  • 0.0.95
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

React hooks for StakeKit API

Utility hooks for interacting with StakeKit API

npm install @stakekit/api-hooks

or

yarn add @stakekit/api-hooks

or

pnpm add @stakekit/api-hooks

Configure API client with proper base url, API key and wrap app with StakeKitQueryProvider:

Example:

import { APIManager, StakeKitQueryProvider, useStakeKitQueryClient } from '@stakekit/api-hooks';

APIManager.configure({
  apiKey: "<your-api-key-here>",
  baseURL: "<your-base-url-here>",
  queryClientConfig: { // optional
    defaultOptions: {
      queries: { cacheTime: 1000 * 30, staleTime: 1000 * 30 },
    },
  }
})

// APIManager.queryClient.clear()

const App = () => {
  const queryClient = useStakeKitQueryClient()

  const logout = () => queryClient.clear()

  return (
    <StakeKitQueryProvider>
      <Main />
      <button onClick={logout} />
    </StakeKitQueryProvider>
  )
}

After configuration part, hooks can be used

Keywords

FAQs

Package last updated on 27 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