A React-based interface library for interacting with Strapi CMS backend, specifically designed for Poolz Finance applications. This package provides a set of hooks and utilities to easily fetch and manage content from your Strapi CMS instance.
- 🎣 React hooks for fetching various content types
- 🔄 Apollo Client integration with caching
- 📱 TypeScript support with generated types
- 🚀 Modern bundle formats (ESM, CJS, UMD)
- 💾 Persistent cache support
- 🎯 Optimized for Poolz Finance content structure
# Using npm
npm install @poolzfinance/strapi
# Using yarn
yarn add @poolzfinance/strapi
# Using pnpm
pnpm add @poolzfinance/strapi
- Wrap your application with the Strapi Provider:
import StrapiProvider from "@poolzfinance/strapi"
function App() {
return (
<StrapiProvider>
{/* Your app components */}
</StrapiProvider>
)
}
- Use the provided hooks in your components:
import { useHeader, useFooter } from "@poolzfinance/strapi";
function MyComponent() {
const { data: headerData } = useHeader();
const { data: footerData } = useFooter();
return (
// Use the data in your component
);
}
The library provides various hooks for fetching different types of content:
useHeader
- Fetch header contentuseFooter
- Fetch footer contentuseAccount
- Fetch account-related contentuseMain
- Fetch main page contentusePageInfos
- Fetch page informationuseVaultFaqs
- Fetch vault FAQs- And many more...
# Install dependencies
pnpm install
# Generate GraphQL types
pnpm compile
# Build the package
pnpm build
# Run tests
pnpm test
Contributions are welcome! Please feel free to submit a Pull Request.
ISC License