# protected()

> Example:

```typescript
import { Protected } from '@magicjs.dev/frontend';

return (
  <Protected>
    <div>This is protected content.</div>
  </Protected>
);
```

> In this example, the content enclosed within the component is rendered exclusively for authenticated users. If a user lacks authentication, the content remains invisible.

[Click here to refer GitHub.](https://github.com/skyslit/magicjs.dev/blob/main/packages/frontend/src/index.tsx#L579)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://skyslit.gitbook.io/magicjs/api-references/frontend/protected.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
