0.1.1 • Published 1 year ago
@hashicorp/platform-edge-utils v0.1.1
@hashicorp/platform-edge-utils
A collection of utilities intended for use in a Next.js edge environment.
Utilities
setGeoCookie
Set's a HashiCorp specific geo cookie so that the client has access to a user's geo information.
Cookie Name | Cookie Value |
---|---|
hc_geo | country={country},region={region} |
// src/middleware.ts
import setGeoCookie from '@hashicorp/platform-edge-utils/lib/set-geo-cookie'
import type { NextRequest } from 'next/server'
export default function middleware(request: NextRequest) {
// Set's a cookie named hc_geo on the response
const response = setGeoCookie(request)
return response
}
0.1.2-canary-202302404810
1 year ago
0.1.1
2 years ago
0.1.0
2 years ago
0.1.0-canary-2022614181233
2 years ago
0.1.0-canary-202261418638
2 years ago
0.1.0-canary-2022614163324
2 years ago
0.1.0-canary-2022614162925
2 years ago
0.1.0-canary-202261415942
2 years ago