> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# onOAuthStateChange

```ts theme={null}
function onOAuthStateChange(callback: OnOAuthStateChangeFn): void;
```

Sets a callback function to be called when the OAuth flow state changes,
i.e. when a user signs in with OAuth.

## Parameters

| Parameter  | Type                                                                                                      | Description                                                           |
| ---------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `callback` | [`OnOAuthStateChangeFn`](/sdks/cdp-sdks-v2/frontend/@coinbase/cdp-core/Type-Aliases/OnOAuthStateChangeFn) | The callback function to be called when the OAuth flow state changes. |

## Returns

`void`
