---
title: "isClientOutdated() · Nuxt Skew Protection · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/skew-protection/nitro-api/is-client-outdated"
last_updated: "2026-08-16T10:15:29.551Z"
meta:
  description: "Server-side utility to check if a client's version is outdated."
  "og:description": "Server-side utility to check if a client's version is outdated."
  "og:title": "isClientOutdated() · Nuxt Skew Protection · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to Skew ProtectionSwitch to Nuxt SEOSwitch to RobotsSwitch to SitemapSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to SEO UtilsSwitch to Site ConfigSwitch to AI Ready

**Nitro API**

# **isClientOutdated()**

**Type:** `**function isClientOutdated(event: H3Event): boolean**`

Returns `**true**` when the client's version cookie doesn't match the current `**buildId**`. Use this in server-side Nitro routes, middleware, and API handlers to detect outdated clients.

## API

```ts
import { isClientOutdated } from 'nuxt-skew-protection/server'

function isClientOutdated(event: H3Event): boolean
```

### Arguments

- `**event: H3Event**`: The H3 event object from the request handler.

### Returns

- `**boolean**`: `**true**` if the client version doesn't match the current buildId, `**false**` otherwise.

## Examples

### Throwing an Error in API Route

```ts
// server/api/data.ts
import { isClientOutdated } from 'nuxt-skew-protection/server'

export default defineEventHandler(async (event) => {
  // Check if client is outdated
  if (isClientOutdated(event)) {
    throw createError({
      statusCode: 409,
      message: 'Client version outdated. Please refresh.'
    })
  }

  // Proceed with API logic
  const data = await fetchData()
  return data
})
```

### Add Header in Middleware

```ts
// server/middleware/check-version.ts
import { isClientOutdated } from 'nuxt-skew-protection/server'

export default defineEventHandler((event) => {
  const path = event.path

  // Only check on API routes
  if (!path.startsWith('/api/')) {
    return
  }

  if (isClientOutdated(event)) {
    const userVersion = getSkewProtectionCookie(event)
    console.log(`Outdated client detected: ${userVersion}`)

    // Add header to inform client
    setResponseHeader(event, 'X-Client-Outdated', 'true')
  }
})
```

**Was this page helpful?**

### **Related **

[**Nitro Hooks**](https://nuxtseo.com/docs/skew-protection/nitro-api/nitro-hooks)

[**Update Notifications**](https://nuxtseo.com/docs/skew-protection/guides/immediate-updates)

[**Configuration** Complete configuration reference for Nuxt Skew Protection.](https://nuxtseo.com/docs/skew-protection/api/config) [**Nitro Hooks** Learn how to use Nitro hooks to track and respond to real-time connections.](https://nuxtseo.com/docs/skew-protection/nitro-api/nitro-hooks)