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

# Irys Upload with $BERA (Node.js)

> Upload files to Irys decentralized storage and pay with Berachain $BERA. Node.js script with Irys SDK.

Use this guide when you want to **upload files** (images, JSON, etc.) to **Irys** (decentralized storage) and **pay with Berachain \$BERA** from a **Node.js** script.

## Repository

* **Code:** [github.com/berachain/guides/tree/main/apps/irys-bera-nodejs](https://github.com/berachain/guides/tree/main/apps/irys-bera-nodejs)
* **README (raw):** [raw README](https://raw.githubusercontent.com/berachain/guides/main/apps/irys-bera-nodejs/README.md)

## Requirements

* Node `v20.11.0` or greater, npm
* Wallet with **mainnet** \$BERA (this example uses mainnet for payment)

## Stack

Node.js, JavaScript/TypeScript, Irys SDK, Berachain mainnet RPC.

## Quick start

1. **Clone and install**
   ```bash theme={null}
   git clone https://github.com/berachain/guides.git && cd guides/apps/irys-bera-nodejs
   npm install
   cp .env.example .env
   ```
2. **Set `WALLET_PRIVATE_KEY`** in `.env` (wallet must hold mainnet \$BERA).
3. **Run upload**
   ```bash theme={null}
   npm run dev
   ```
   Script reports file size, cost in \$BERA, balance, and returns the Irys receipt and gateway URL (e.g. `https://gateway.irys.xyz/<id>`).

## Key files

| Purpose       | Path                                                            |
| ------------- | --------------------------------------------------------------- |
| Upload script | See repo (e.g. `app/` or root script; README names exact entry) |
