# Client logic in SSR

Learn how to use client-side methods in server-rendered code.

The methods exposed by the [`useCroct`](/reference/sdk/hydrogen/api/hooks/use-croct) hook only run on the client. Calling one while the component renders on the server throws an error like the one below:

> **Error**
>
> Property `croct.someMethod` is not supported on server-side (SSR). Consider refactoring the logic as a side-effect (`useEffect`) or a client-side callback (`onClick`, `onChange`, etc).

Call these methods from a [`useEffect`](https://react.dev/reference/react/useEffect) hook or an event handler such as `onClick` or `onChange`, so they run after hydration.

For server-side operations, use the server functions from a loader or action instead: fetch content with [`fetchContent`](/reference/sdk/hydrogen/api/functions/fetch-content), evaluate queries with [`evaluate`](/reference/sdk/hydrogen/api/functions/evaluate), and manage identity with [`identify`](/reference/sdk/hydrogen/api/functions/identify) and [`anonymize`](/reference/sdk/hydrogen/api/functions/anonymize).
