# attributes option ignored in fetchContent but works in useContent

Asked by oskar_nw on 2025-07-15. Tags: nextjs, react, content.

working on a client project at our agency, passing attributes to influence the
content resolution. on the client this works fine:

```tsx
const content = useContent('home-hero', {
    attributes: {plan: 'enterprise'},
});
```

so i did the same thing on the server:

```ts
const content = await fetchContent('home-hero', {
    attributes: {plan: 'enterprise'},
});
```

no error, but the attirbutes seem to be completely ignored, the audience that
depends on them never matches. same slot, same attributes, only difference is
server vs client. thanks in advance everyone

## 1 answer

### Answer from rafal_k (2025-07-15)

You hit a real shape difference between the two APIs. The React `useContent`
hook takes `attributes` at the top level, but the Next.js server-side
`fetchContent` expects them nested under `context`:

```ts
import {fetchContent} from '@croct/plug-next/server';

const content = await fetchContent('home-hero', {
    fallback: {...},
    context: {
        attributes: {plan: 'enterprise'},
    },
});
```

The full server signature is
`fetchContent('home-hero', {fallback, preferredLocale, context: {attributes}})`.
Your top-level `attributes` key was silently ignored because the server
options object simply does not have that field, which is why there was no
error to point you at the problem.

#### Reply from oskar_nw (2025-07-16)

ah that explains it, moved them under context and the audience matches
now. thanks!
