# Getting Started

**URL:** https://heroiclabs.com/docs/hiro/python/getting-started/
**Keywords:** getting started, hiro
**Categories:** hiro, python, getting-started

---


## Overview

This quickstart guides you through:

- [Installation](#installation)
- [Usage](#usage)

It is intended for developers who want to integrate the Hiro Python client into their applications. It assumes that you have basic knowledge of:

- Python programming
- Dependency management with pip
- Environment variables

## Installation

### Requirements

- **Python 3.8+** (tested on Python 3.8.1 and 3.12.4)
- **pip** package manager
- **Obtain access to the Python client** from Heroic Labs. [Contact us](mailto:contact@heroiclabs.com) if you don't have access yet.

### Install Dependencies

Install the required dependencies using pip in the directory that contains `pyproject.toml`:

```bash
pip install .
```

## Usage

Once you have the client and have followed the installation steps, you can import the Hiro and Nakama libraries to the project:

```py
from hiro_gdk.nakama_client import NakamaClient, NakamaError
from hiro_gdk.hiro_client import HiroClient
```

For this guide we will also be using:

```py
import os
import sys
import asyncio
import logging
import uuid

from dotenv import load_dotenv
```

Set up the Nakama client:

```py
server_key = os.environ.get("NAKAMA_SERVER_KEY", "defaultkey")
host = os.environ.get("NAKAMA_HOST", "127.0.0.1")
port = int(os.environ.get("NAKAMA_PORT", "7350"))
nakama_client = NakamaClient(host=host, port=port, ssl=False, server_key=server_key)
```

Authenticate the user:

```py
first_device_id = f"basic_usage-first-device-{uuid.uuid4().hex[:8]}"
first_username = f"basic_usage-first_user-{uuid.uuid4().hex[:8]}"
print(f"🔑 Authenticating second device ID: {first_device_id}...")
session1 = await nakama_client.authenticate_device(first_device_id, create=True, username=first_username)
```

Create the Hiro client:

```py
hiro_client = HiroClient(nakama_client)
```

## Next Steps

Now that you've completed this getting started, explore these resources to learn more about the Hiro Python client and Nakama server integration:

- [Implementing Achievements](../achievements/)
- [Economy System](../economy/)
- [Inventory Management](../inventory/)
