# Installation

**Step 1. Installation**

Install the pointNG script on every page you wish to use pointNG by pasting it before closing \</body> tag.

```
<script src="https://cdn.pointng.io/pointng-min.js"></script> 
```

pointNG adds a 99kB JS bundle that includes all the features.

{% hint style="info" %}
Please note that pointNG is in beta and is still undergoing final testing before its official release.
{% endhint %}

**Step 2**. **Configuration**

Below your tracking script, paste this code to initialize pointNG and set up your parameters

```
const pointng = new PointNG({ 
    level: 'country',
    api_key: "YOUR-API-KEY-HERE"
}); 
```

Use the 'level' parameter to choose the level you wish to identify your users' location. Options are 'continent', 'country', 'state' and 'city' To optimize speed, we recommend that you use the level that is necessary in your service.

If a user does not permit the use of GPS-data, pointNG uses the device time zone as default fallback to estimate the location.

####

#### Step 3. Obtain your API-key

To get your free API key, sign up for free [here](https://app.pointng.io).

After signing in, add your first website. This generates the needed API keys and whitelists your domain.

![](/files/-MJX61bKWm-YuQxnPmXN)

Insert your public API key to 'api\_key' that is displayed on pointNG web-portal after you create a website. In test environment, please use the 'TEST Public API key'.

#### Step 4. Drive!

Success! Now you are ready to start using pointNG secure functions. Below is an example of a minimum implementation that prompts the user for location permission and console.logs the user location result.

```
<script src="https://cdn.pointng.io/pointng-min.js"></script> 
<script>
    const pointng = new PointNG({ 
        level: 'continent', 
        api_key: "YOUR-API-KEY"
    });

    pointng.getLocation().then(function(prediction) {
        console.log(prediction)
        //Do your magic here!
    })
</script>
```

That's it! Head over to the next section to learn how pointNG functions work.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://globalreactioncompany.gitbook.io/pointng/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
