> For the complete documentation index, see [llms.txt](https://payana-saas.gitbook.io/payana-saas-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://payana-saas.gitbook.io/payana-saas-docs/dokumentasi-teknis/variabel-lingkungan.md).

# Variabel Lingkungan

Referensi lengkap env var per layanan. **Jangan pernah commit nilai asli** — file ini hanya mendaftar nama dan kegunaannya.

## payana-contract (`foundry.toml`)

| Variabel               | Kegunaan                                                  |
| ---------------------- | --------------------------------------------------------- |
| `BASE_SEPOLIA_RPC_URL` | RPC untuk deploy/testing di testnet                       |
| `BASE_RPC_URL`         | RPC untuk mainnet (belum dipakai — testnet-only saat ini) |
| `BASESCAN_API_KEY`     | Verifikasi kontrak otomatis pasca-deploy                  |

## payana-indexer

| Variabel                               | Kegunaan                                                                                  |
| -------------------------------------- | ----------------------------------------------------------------------------------------- |
| `PONDER_RPC_URL_84532`                 | RPC Base Sepolia untuk indexing — wajib provider asli (Alchemy dkk), bukan default publik |
| `DATABASE_URL`                         | Koneksi PostgreSQL                                                                        |
| `DATABASE_SCHEMA`                      | Skema tempat Ponder menulis — harus sama dengan punya backend                             |
| `PAYROLL_CONTRACT_ADDRESS`             | Alamat `PayrollFactory` (nama variabel historis, bukan salah ketik)                       |
| `PAYROLL_START_BLOCK`                  | Blok mulai indexing — pakai blok deploy factory, jangan 0                                 |
| `SBT_CONTRACT_ADDRESS`, `IDRX_ADDRESS` | Harus sama generasi dengan `payana-contract`                                              |

## payana-backend

| Kategori        | Variabel                                                                                      |
| --------------- | --------------------------------------------------------------------------------------------- |
| Server          | `PORT`, `FRONTEND_URL` (origin CORS — harus persis sama dengan domain frontend live)          |
| Auth            | `JWT_SECRET`, `JWT_REFRESH_SECRET`                                                            |
| Database        | `DATABASE_URL`, `DATABASE_SCHEMA` (harus sama dengan punya indexer)                           |
| Chain / bundler | `PIMLICO_API_KEY`, `BUNDLER_RPC_URL`, `BASE_RPC_URL`, `ENTRY_POINT_ADDRESS`                   |
| Kontrak         | `PAYROLL_CONTRACT_ADDRESS`, `PAYROLL_FACTORY_ADDRESS`, `SBT_CONTRACT_ADDRESS`, `IDRX_ADDRESS` |
| Webhook         | `ALCHEMY_WEBHOOK_KEY`, `OPS_ALERT_WEBHOOK_URL`                                                |
| Operasional     | `OWNER_ADDRESS`, `OPS_PRIVATE_KEY`, `PAYMASTER_ALERT_THRESHOLD_ETH`, `MAX_CLAIMS_PER_HOUR`    |
| Keamanan        | `ENCRYPTION_KEY` (AES-256-GCM untuk PII)                                                      |

## payana-frontend

Semua diawali `NEXT_PUBLIC_` — dibakukan ke dalam bundle klien saat build, **jangan pernah taruh rahasia di sini**.

| Variabel                                                                                              | Kegunaan                                          |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `NEXT_PUBLIC_PRIVY_APP_ID`                                                                            | App ID Privy (embedded wallet)                    |
| `NEXT_PUBLIC_PAYROLL_FACTORY_ADDRESS`, `NEXT_PUBLIC_SBT_CONTRACT_ADDRESS`, `NEXT_PUBLIC_IDRX_ADDRESS` | Harus sama generasi dengan layanan lain           |
| `NEXT_PUBLIC_CHAIN_ID`                                                                                | `84532` (Base Sepolia)                            |
| `NEXT_PUBLIC_OWNER_ADDRESS`                                                                           | Alamat owner platform (menentukan akses `/owner`) |
| `NEXT_PUBLIC_RPC_URL`                                                                                 | RPC untuk pembacaan on-chain langsung             |
| `NEXT_PUBLIC_BACKEND_URL`                                                                             | Base URL `payana-backend`                         |
| `NEXT_PUBLIC_PONDER_URL`                                                                              | Base URL `payana-indexer`                         |

{% hint style="danger" %}
`PAYROLL_CONTRACT_ADDRESS` / `PAYROLL_FACTORY_ADDRESS` / `NEXT_PUBLIC_PAYROLL_FACTORY_ADDRESS` — tiga nama berbeda untuk alamat yang **harus sama** di ketiga layanan. Mismatch di sini adalah penyebab bug lintas-layanan paling umum. Lihat [Konvensi Kunci](/payana-saas-docs/arsitektur/konvensi-kunci.md#4-tiga-layanan-harus-sepakat-soal-generasi-kontrak).
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://payana-saas.gitbook.io/payana-saas-docs/dokumentasi-teknis/variabel-lingkungan.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
