> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.makeswift.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.makeswift.com/_mcp/server.

# getSiteVersion

> A function that returns the current version of the Makeswift site. This function is currently only used when calling `getPageSnapshot` when using **App Router** in Next.js.

A function that returns the current version of the Makeswift site. This function is currently only used when calling `getPageSnapshot` when using **App Router** in Next.js.

> **Warning**
>
> This function can only be called inside of a [React Server Component](https://react.dev/reference/rsc/server-components) or [Route Handler](https://nextjs.org/docs/app/building-your-application/routing/route-handlers).

## Arguments

This function doesn't take any arguments.

## Example

The following example calls [getPageSnapshot](/developer/docs/reference/client/get-page-snapshot) to query a page snapshot for the root route and passes the return value from `getSiteVersion` in its configuration options. It then renders the page using the [Page](/developer/docs/reference/components/page) component.

```tsx
import { Page } from "@makeswift/runtime/next";
import { client } from "@/makeswift/client";
import { getSiteVersion } from "@makeswift/runtime/next/server";

export default function Page() {
  const snapshot = await client.getPageSnapshot("/", {
    siteVersion: getSiteVersion(),
  });

  if (snapshot == null) notFound();

  return <Page snapshot={snapshot} />;
}
```

For a more detailed walkthrough, refer to the [App Router Installation guide](/developer/docs/get-started/installation/app-router).