@hashicorp/platform-edge-utils

0.1.1 • Public • Published

@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
}

Readme

Keywords

none

Package Sidebar

Install

npm i @hashicorp/platform-edge-utils

Weekly Downloads

7,032

Version

0.1.1

License

none

Unpacked Size

3.53 kB

Total Files

4

Last publish

Collaborators

  • gstewart-hashi
  • prestonbourne
  • mikegolus
  • leahmariebush
  • kaitlynnefuery
  • abhishek-hashicorp
  • cameronperera
  • alexju
  • consul-ui-services
  • hashicb
  • britt.lindgren
  • paulhcp
  • nandereck
  • tstormk
  • hashibot-hds
  • lackeyjb1
  • jpogran
  • thrashr888
  • melsumner
  • didoo
  • zchsh
  • hcitsec
  • gregone
  • meirish
  • enmod
  • kaxcode
  • anubhavmishra-hashicorp
  • hashibot-web
  • cstitt-hashi
  • mocohen
  • dhaulagiri