Location-Based Access Control Made Easy with Next.js and IPInfo

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • demo-projects

  • Learn more about Permit or IPInfo — or access the whole code repository for this project here.

  • cli

    Official Command Line Interface for the IPinfo API (IP geolocation and other types of IP data) (by ipinfo)

  • import { Permit } from "permitio"; const permit = new Permit({ pdp: "http://localhost:7766", // your API Key token: process.env.PERMIT_API_KEY, }); const fetchLocationByIP = async () => { const request = await fetch( `https://ipinfo.io/json?token=${process.env.IP_INFO_TOKEN}` ); const jsonResponse = await request.json(); console.log(jsonResponse.ip, jsonResponse.country); return jsonResponse.country; }; export default async function enforceAccess(req, res) { // Getting the country code and storing in a variable const IPlocation = await fetchLocationByIP(); const allowed = await permit.check( { key: "[email protected]", attributes: { // Passing the variable to the ip_location attribute ip_location: IPlocation, }, }, "view", { type: "only-uk", tenant: "default", } ); res.status(200).send({ allowed }); return allowed; }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • react-native-auth0

    React Native toolkit for Auth0 API

  • If you would like to check out a guide on how to add a user to Permit after successful authentication with Auth0, check out the article here.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • DNS traffic can leak outside the VPN tunnel on Android

    2 projects | news.ycombinator.com | 3 May 2024
  • Fetch Geo Data from any IP Address in React

    1 project | dev.to | 13 Mar 2024
  • Live proxy and VPN detection

    1 project | news.ycombinator.com | 31 Dec 2023
  • Please help me to setup nordvpn on my router

    1 project | /r/nordvpn | 11 Dec 2023
  • Configuration Proxy Helper Chrome Extension with Okey Proxy

    1 project | /r/u_OkeyProxy | 8 Dec 2023