React library
GalleryProvider
Configure client-side loading, caching, and public identity.
'use client';
import { GalleryProvider } from '@degallery/react';
export function Providers({ children }: { children: React.ReactNode }) {
return (
<GalleryProvider
apiUrl="https://api.degallery.mpotulo.com"
publishableKey={process.env.NEXT_PUBLIC_DEGALLERY_KEY}
>
{children}
</GalleryProvider>
);
}Props include:
| Prop | Purpose |
|---|---|
apiUrl | API origin used by the client |
publishableKey | Public browser-safe identity |
readToken | Bounded read credential when issued by your server |
queryClient | Optional TanStack Query client |
queryClientConfig | Optional query defaults |
children | Components using gallery context |
The default query settings use a one-minute stale time and do not refetch on window focus. Supply your own QueryClient when the application already owns TanStack Query configuration.