-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Overview This PR removes the `geo` and `ip` properties from `NextRequest` for Next.js 15. These values had to be provided by your hosting provider. Since this feature was not generally useful for the broader Next.js community (outside of Vercel), we feel it makes more sense to keep this as a Vercel-specific feature and not something built into the framework. ### Alternatives If you are using Vercel, you can alternatively use the `geolocation` and `ipAddress` functions from [`@vercel/functions`](https://vercel.com/docs/functions/vercel-functions-package) instead: ```js filename="middleware.ts" import { geolocation, ipAddress } from '@vercel/functions'; import type { NextRequest } from 'next/server' export function middleware(request: NextRequest) { const { city } = geolocation(request); const ip = ipAddress(request) // ... } ``` --------- Co-authored-by: Eng Zer Jun <[email protected]>
- Loading branch information
Showing
6 changed files
with
32 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters