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:

PropPurpose
apiUrlAPI origin used by the client
publishableKeyPublic browser-safe identity
readTokenBounded read credential when issued by your server
queryClientOptional TanStack Query client
queryClientConfigOptional query defaults
childrenComponents 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.