@rss3/api-react-query
TypeScript icon, indicating that this package has built-in type declarations

0.0.25 • Public • Published

RSS3 Logo

RSS3 React Query SDK

npm package npm bundle size follow RSS3 on X discord chat

React Query hooks for the RSS3 JavaScript SDK.

  • Easy integration with React applications using React Query
  • Fully typed hooks for all RSS3 API endpoints
  • Optimized for performance with built-in caching and request deduplication

Installation

npm i @rss3/api-react-query @tanstack/react-query

Note: This package requires @tanstack/react-query as a peer dependency.

Getting Started

First, set up the React Query provider in your app:

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

const queryClient = new QueryClient()

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      {/* Your app components */}
    </QueryClientProvider>
  )
}

Then, you can use the hooks in your components:

Fetch Activities

import { useGetActivities } from '@rss3/api-react-query'

function ActivityFeed() {
  const { data, isLoading, error } = useGetActivities({
    account: "vitalik.eth",
    tag: ["social"],
    type: ["comment"],
    platform: ["Farcaster"],
  });

  if (isLoading) return <div>Loading...</div>
  if (error) return <div>Error: {error.message}</div>

  return (
    <ul>
      {data?.map(activity => (
        <li key={activity.id}>{activity.content}</li>
      ))}
    </ul>
  )
}

Documentation

For more detailed information about the available hooks and their usage, please refer to the RSS3 API documentation.

License

MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i @rss3/api-react-query

Weekly Downloads

1

Version

0.0.25

License

none

Unpacked Size

20.5 MB

Total Files

417

Last publish

Collaborators

  • henrywang
  • yzhe819
  • songkeys