> 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.

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
