New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stakekit/api-hooks

Package Overview
Dependencies
Maintainers
5
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.83
npm
Version published
Maintainers
5
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

stakekit

FAQs

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