---
title: "useConvexController"
description: "Reference for the advanced controller used for delayed connection, reconfiguration, and explicit disconnect flows."
canonical_url: "https://nuxt-convex.onmax.me/api-reference/use-convex-controller"
---
# useConvexController

> Reference for the advanced controller used for delayed connection, reconfiguration, and explicit disconnect flows.

`useConvexController` returns the advanced runtime controller from `vue-convex/advanced`.

## Import

```ts
import { useConvexController } from 'vue-convex/advanced'
```

In Nuxt, the same types and functions are available through `#convex/advanced`.

## Signature

```ts
function useConvexController(): {
  options: Readonly<Ref<ResolvedConvexVueOptions>>
  status: Readonly<Ref<'connected' | 'disconnected'>>
  connect: (options: ConvexControllerConnectOptions) => void
  reconfigure: (options: Partial<ConvexControllerConnectOptions>) => void
  disconnect: () => void
  getClient: () => ConvexClient | undefined
  getHttpClient: () => ConvexHttpClient | undefined
}
```

`ConvexControllerConnectOptions` is the [`convexVue` options](https://nuxt-convex.onmax.me/api-reference/convex-vue) with a required `url`.

## Behavior

- `connect()` requires a URL. Options you leave out keep their current value
- `reconfigure()` requires that a URL is already configured, and throws otherwise
- Both close the current realtime client and create a new one in the browser; queries resubscribe and `useConvexAuth` applies its token fetcher again
- The HTTP client is created on first use, not on `connect()`
- `disconnect()` closes the realtime client, clears the URL and resets auth state

`createConvexVueController(options)` returns a controller with its own runtime, not installed in any app, for scripts and tests. Composables read the runtime installed by `convexVue`, not this one.

## Related pages

- [Controller](https://nuxt-convex.onmax.me/vue-guide/controller)
- [useConvexClient](https://nuxt-convex.onmax.me/api-reference/use-convex-client)
- [useConvexHttpClient](https://nuxt-convex.onmax.me/api-reference/use-convex-http-client)
- [useConvexConnectionState](https://nuxt-convex.onmax.me/api-reference/use-convex-connection-state)


## Sitemap

See the full [sitemap](https://nuxt-convex.onmax.me/sitemap.md) for all pages.
