# Get the Latest Package ID

## **getPackageId - NAVI API**

The `getPackageId` API is publicly accessible and retrieves the latest package information for the NAVI Protocol. This endpoint provides the current `packageId` in use, along with a list of outdated package IDs for reference. It helps developers ensure they are working with the most up-to-date package when interacting with NAVI's smart contracts.

{% openapi src="/files/pZQa4H5YchxKObjiti7h" path="/api/package" method="get" %}
[package.json](https://2230654657-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWcKfs3vWiDuhitgCkBQQ%2Fuploads%2FbBdQlQoUTZgRIwRtsE3p%2Fpackage.json?alt=media\&token=8a9f11ff-472a-4dd1-a95a-92769dfa9308)
{% endopenapi %}

## **getPackageId - NAVI SDK**

The `getLatestProtocolPackageId` function in the NAVI SDK retrieves the most recent `packageId` used in the NAVI Protocol. This function is essential for PTB developers to ensure they are interacting with the latest version of NAVI’s smart contracts in their JavaScript-based code.

```javascript
import { getLatestProtocolPackageId } from 'navi-sdk/dist/libs/PoolInfo';

const id = await getLatestProtocolPackageId();
```


---

# 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://naviprotocol.gitbook.io/navi-protocol-developer-docs/contract-configuration/get-the-latest-package-id.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.
