Skip to content

Commit

Permalink
Update next/server documentation for geo (#33609)
Browse files Browse the repository at this point in the history
Make it clear that `geo` is not populated by the default Next.js server, and requires your hosting platform to integrate with a geolocation service to look up the location based on the request.

If self-hosting, for example, this could be achieved with the [Google Geolocation API](https://developers.google.com/maps/documentation/geolocation/overview).
  • Loading branch information
leerob committed Jan 24, 2022
1 parent 749eb10 commit a0e3e14
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions docs/api-reference/next/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ The `NextRequest` object is an extension of the native [`Request`](https://devel

- `cookies` - Has the cookies from the `Request`
- `nextUrl` - Includes an extended, parsed, URL object that gives you access to Next.js specific properties such as `pathname`, `basePath`, `trailingSlash` and `i18n`
- `geo` - Has the geo location from the `Request`
- `geo.country` - The country code
- `geo.region` - The region code
- `geo.city` - The city
- `geo.latitude` - The latitude
- `geo.longitude` - The longitude
- `ip` - Has the IP address of the `Request`
- `ua` - Has the user agent
- `geo` - (Optional) Has the geo location from the `Request`, provided by your hosting platform

You can use the `NextRequest` object as a direct replacement for the native `Request` interface, giving you more control over how you manipulate the request.

Expand Down

0 comments on commit a0e3e14

Please sign in to comment.