> For the complete documentation index, see [llms.txt](https://naviprotocol.gitbook.io/navi-protocol-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://naviprotocol.gitbook.io/navi-protocol-developer-docs/contract-configuration/get-the-latest-package-id.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://naviprotocol.gitbook.io/navi-protocol-developer-docs/contract-configuration/get-the-latest-package-id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
