Capxul Docs
How-to guides

Bring an existing QueryClient

Share an application query cache without leaking Capxul state across client identities.

Pass an existing TanStack QueryClient when the application already owns one:

<CapxulProvider publishableKey={publishableKey} queryClient={queryClient}>
  <App />
</CapxulProvider>

Pass the instance once. The provider pins the first queryClient for its mounted lifetime; replacing the prop does not replace the cache.

All owned keys begin with ["capxul"]. When the client identity changes, the provider removes those keys from a caller-owned cache while preserving unrelated application queries. When it owns the QueryClient, it clears that private cache instead.