Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.24 KB

File metadata and controls

40 lines (28 loc) · 1.24 KB

Netlify examples

{Name of example} with Netlify Edge Functions

You can use geolocation data to identify a user's country and block content if required.

Geolocation information is available on the Context.geo object.

context: {
  geo: {
    city?: string;
    country?: {
      code?: string;
      name?: string;
    },
    subdivision?: {
      code?: string;
      name?: string;
    },
  }
}

Code example

Edge Functions are files held in the netlify/edge-functions directory.

View this example on the web

Deploy to Netlify

You can deploy this and all the other examples in this repo as a site of your own to explore and experiment with, by clicking this button.

Deploy to Netlify