@poolzfinance/strapi
v1.3.4
Published
[](https://www.npmjs.com/package/@poolzfinance/strapi)
Readme
InterfaceStrapi
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.
Features
- 🎣 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
Installation
# Using npm
npm install @poolzfinance/strapi
# Using yarn
yarn add @poolzfinance/strapi
# Using pnpm
pnpm add @poolzfinance/strapiUsage
- 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
);
}Available Hooks
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...
Development
# Install dependencies
pnpm install
# Generate GraphQL types
pnpm compile
# Build the package
pnpm build
# Run tests
pnpm testContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
ISC License
