> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openformat.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Geolocation Reward

> Easily integrate location-based rewards into your app. This template verifies user presence at specific locations using a set of given coords and automatically issues on-chain badges to their web3 account. Perfect for gamification, enhancing user engagement, and promoting exploration.

## Use cases

1. **Geofencing**: Determining if a user has entered or exited a specific geographic area.
2. **Proximity-based rewards**: Unlocking rewards or features when users are near specific locations, perfect for gamification, tourism apps, or retail promotions.
3. **Event check-ins**: Verifying a user's presence at events, meetings, or specific locations, ideal for event management and attendance tracking.

## Video Setup

<iframe width="100%" height="500" src="https://www.loom.com/embed/3f068b119d004cb087340904a09cbfc5?sid=a7d1ced2-35a3-4ccd-b6d9-e05d1e09d758" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen />

## Prerequisites

1. **Setup OPENFORMAT**

   Before you can continue, please complete the following steps to obtain the necessary credentials:

   1. **Go to the [OPENFORMAT Dashboard](https://app.openformat.tech)**
   2. **Register** for an account
   3. **Generate an API Key**
   4. **Create a dApp**
   5. **Create a Badge** (only if required)

2. **Receiver Address**

   You will need the account address for the user you are rewarding e.g. `0xeed12ae3b7cc78ea09ba4cc6e34a997b969ea8e6`

## Get Started

<Steps>
  <Step title="OPENFORMAT Node Inputs">
    Add your OPENFORMAT `API Key`, `dApp ID`, `Badge Name` and `Private Key` into
    the Reward Badge Node inputs.
  </Step>

  <Step title="Test Integration">
    To test the integration, click on **Test** and add the `latitude` and `longitude` of your user's current location, the `distance` (in kilometers) to check if the user is near the target location, and the `receiver` to the body of the request. For example:

    ```json theme={null}
    {
      "latitude": 51.51175,
      "longitude": -0.1387,
      "distance": 1,
      "receiver": "0x02f573bb36fafedb59612671d72121c0cb49aaef"
    }
    ```

    <video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/openformat/vGurOUJG2onkcsD3/images/geolocation-reward/geolocation-test.mp4?fit=max&auto=format&n=vGurOUJG2onkcsD3&q=85&s=3f9ae8920ab141207f93679ad84522b2" data-path="images/geolocation-reward/geolocation-test.mp4" />
  </Step>
</Steps>

## Node Inputs

### Reward Badge

| Key           | Description                                                                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `API Key`     | Your OPENFORMAT API Key. You can find this in the Settings page of the [Dashboard](https://app.openformat.tech) (String)                                                             |
| `dApp ID`     | The ID of your OPENFORMAT dApp. You can get this in the [Dashboard](https://app.openformat.tech) (String, max 32 characters)                                                         |
| `Private Key` | The Private Key of your web3 account. You can find this in the Settings page of the [Dashboard](https://app.openformat.tech).                                                        |
| `Badge Name`  | The name of the badge that you are awarding, this must exactly match the name of the badge created. You can create a badge in the [Dashboard](https://app.openformat.tech). (string) |
| `Receiver`    | The address of the receiver, which will be the existing web3 account or the newly generated account.                                                                                 |
| `Await`       | Wait for the transaction to be confirmed on the blockchain. (Boolean, default: true)                                                                                                 |
