---
title: "getNitroOrigin()"
description: "Get the runtime origin URL safely across development, prerendering, and production environments."
canonical_url: "https://nuxtseo.com/docs/site-config/api/get-nitro-origin"
last_updated: "2026-05-25T04:22:32.964Z"
---

A utility function to get the Nitro origin from the request headers.

This is a replacement for `useRequestOrigin()` which has edge-cases issues in development, prerendering and in some runtime
environments.

The nitro origin acts as the canonical origin for the site when you have not provided a `url`.

## Usage

```ts
import { getNitroOrigin } from '#imports'

const origin = getNitroOrigin()
// https://www.example.com/
```
