---
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"
---

> Index of every page on this site: [llms.txt](https://nuxtseo.com/llms.txt)

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

This is a replacement for `useRequestOrigin()`{lang="ts"} 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 '#site-config/app'

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

## Sitemap

See the full [sitemap](https://nuxtseo.com/sitemap.md) for all pages.
