> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# useAuthorizeVehicle

React mutation hook for authorizing a vehicle in the VehicleManager.

## Import

```ts
import { useAuthorizeVehicle } from '@railnetorg/railnet-sdk/react'
```

## Usage

```tsx
import { useAuthorizeVehicle } from '@railnetorg/railnet-sdk/react'

function Authorize() {
  const { mutateAsync, isPending } = useAuthorizeVehicle()

  const handleAuthorize = async () => {
    await mutateAsync({
      vehicleManager: '0x...',
      vehicle: '0x...',
      account: '0x...',
    })
  }

  return (
    <button disabled={isPending} onClick={handleAuthorize}>
      Authorize Vehicle
    </button>
  )
}
```

## Returns

```ts
UseMutationResult<Hash, Error, AuthorizeVehicleParameters & { account: Address }>
```

Mutation result. Call `mutate` or `mutateAsync` with [`authorizeVehicle`](/actions/authorizeVehicle) parameters.
