# useRemoveOauthProvider | @account-kit/react

> Overview of the useRemoveOauthProvider hook from @account-kit/react

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function useRemoveOauthProvider(mutationArgs?): UseRemoveOauthProviderResult;
```

Defined in: [account-kit/react/src/hooks/useRemoveOauthProvider.ts:52](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useRemoveOauthProvider.ts#L52)

A custom hook to handle removing an OAuth provider from an already authenticated account, which includes executing a mutation with optional parameters.

## Example

```ts twoslash
import { useRemoveOauthProvider } from "@account-kit/react";

const { removeOauthProvider, isRemovingOauthProvider, error } =
  useRemoveOauthProvider({
    // these are optional
    onSuccess: () => {
      // do something on success
    },
    onError: (error) => console.error(error),
  });
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `mutationArgs?`
      </td>

      <td>
        `Partial`\<`Omit`\<`UseMutationOptions`\<`void`, `Error`, `string`, `unknown`>, `"mutationFn"` | `"mutationKey"`>>
      </td>

      <td>
        Optional arguments for the mutation used for removing an OAuth provider.
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`UseRemoveOauthProviderResult`](../type-aliases/UseRemoveOauthProviderResult)

An object containing the `removeOauthProvider` function, `removeOauthProviderAsync` for async execution, a boolean `isRemovingOauthProvider` to track the mutation status, and any error encountered.