> For the complete documentation index, see [llms.txt](https://docs.zama.org/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/protocol/sdk/api-references/react/useconfidentialisoperator.md).

# useConfidentialIsOperator

Check if a spender is an approved operator for a holder's confidential tokens.

## Import

```ts
import { useConfidentialIsOperator } from "@zama-fhe/react-sdk";
```

## Usage

{% tabs %}
{% tab title="OperatorStatus.tsx" %}

```tsx
import { useConfidentialIsOperator } from "@zama-fhe/react-sdk";

function OperatorStatus({
  tokenAddress,
  holder,
  spender,
}: {
  tokenAddress: `0x${string}`;
  holder: `0x${string}`;
  spender: `0x${string}`;
}) {
  const { data: isOperator, isLoading } = useConfidentialIsOperator({
    address: tokenAddress,
    holder,
    spender,
  });

  if (isLoading) return <span>Checking operator status...</span>;
  return <span>{isOperator ? "Approved" : "Not approved"}</span>;
}
```

{% endtab %}
{% endtabs %}

## Parameters

### address

`Address`

Address of the confidential token contract.

### holder

`Address | undefined`

Address of the token holder. The query is disabled while `undefined`.

### spender

`Address | undefined`

Address of the operator to check. The query is disabled while `undefined`.

```ts
const { data: isOperator } = useConfidentialIsOperator({
  address: "0xToken",
  holder: "0xOwner",
  spender: "0xDEX",
});
```

## Return Type

`data` is `boolean` — `true` if the spender has an active approval for the given holder, `false` otherwise.

## Suspense

Use `useConfidentialIsOperatorSuspense` inside a `<Suspense>` boundary. The hook throws a promise while loading, so `data` is always defined.

```tsx
import { useConfidentialIsOperatorSuspense } from "@zama-fhe/react-sdk";
import { Suspense } from "react";

function OperatorCheck({
  tokenAddress,
  holder,
  spender,
}: {
  tokenAddress: `0x${string}`;
  holder: `0x${string}`;
  spender: `0x${string}`;
}) {
  const { data: isOperator } = useConfidentialIsOperatorSuspense({ tokenAddress, holder, spender });

  // data is always defined — no loading state needed
  return <span>{isOperator ? "Approved" : "Not approved"}</span>;
}

function App() {
  return (
    <Suspense fallback={<span>Loading...</span>}>
      <OperatorCheck tokenAddress="0xToken" holder="0xOwner" spender="0xDEX" />
    </Suspense>
  );
}
```

## Related

* [`useConfidentialSetOperator`](/protocol/sdk/api-references/react/useconfidentialsetoperator.md) — approve an operator
* [`Token.isOperator()`](/protocol/sdk/api-references/sdk/token.md#isoperator) — imperative equivalent on the SDK class


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.zama.org/protocol/sdk/api-references/react/useconfidentialisoperator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
