Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
VITE_BACKEND_URL=/api
# UTM settings for shared profile links (optional)
# Set any of these to enable UTM parameters on shared profile URLs.
VITE_UTM_SOURCE=twitter
VITE_UTM_MEDIUM=social
VITE_UTM_CAMPAIGN=share_profile
#VITE_UTM_TERM=
#VITE_UTM_CONTENT=
# Access Layer Client — environment variables
# Copy this file to `.env` and adjust values as needed:
# cp .env.example .env
# All client-exposed variables must be prefixed with VITE_ (see https://vitejs.dev/guide/env-and-mode).
# See CONTRIBUTING.md ("Environment variables") for which vars are required vs optional.

# --- Required (sensible defaults provided) ---

# Base URL for the backend API. Use the local backend during development.
VITE_BACKEND_URL=http://localhost:3000/api/v1

# Chain ID selected by default on load. 84532 = Base Sepolia testnet.
VITE_DEFAULT_CHAIN_ID=84532

# RPC URL for a local Anvil node (chain 31337). Used when developing against a local chain.
VITE_ANVIL_RPC_URL=http://127.0.0.1:8545

# RPC URL for the Base Sepolia testnet (chain 84532). The public default works out of the box.
VITE_BASE_SEPOLIA_RPC_URL=https://sepolia.base.org

# --- Optional ---

# RPC URL for the Ethereum Sepolia testnet (chain 11155111). Get one from Alchemy, Infura, or another provider.
VITE_SEPOLIA_RPC_URL=

# RPC URL for Ethereum mainnet (chain 1). Only needed when testing against mainnet.
VITE_MAINNET_RPC_URL=

# UTM settings for shared profile links (optional)
# Set any of these to enable UTM parameters on shared profile URLs.
# Remove or comment out to disable UTM tracking.
# Example configuration:
# UTM parameters appended to shared profile links (optional).
# Set any of these to enable UTM tracking; remove or leave blank to disable.
VITE_UTM_SOURCE=accesslayer
VITE_UTM_MEDIUM=share
VITE_UTM_CAMPAIGN=profile-sharing
Expand Down
42 changes: 41 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ Thanks for contributing to the frontend for Access Layer, a Stellar-native creat
## Local setup

1. Install Node.js 20+ and `pnpm`.
2. Copy `.env.example` to `.env` and add any local values you need.
2. Copy `.env.example` to `.env` and adjust values as needed (see [Environment variables](#environment-variables)):

```bash
cp .env.example .env
```

3. Install dependencies:

```bash
Expand All @@ -25,6 +30,41 @@ pnpm install
pnpm dev
```

## Environment variables

All client-exposed variables are prefixed with `VITE_` so Vite can expose them to the
browser. The defaults in `.env.example` are enough to run the client locally — you only
need to fill in optional values for the networks you actually want to test against.
Validation lives in [`src/utils/env.utils.ts`](./src/utils/env.utils.ts).

### Required (defaults provided)

| Variable | Description |
| --- | --- |
| `VITE_BACKEND_URL` | Base URL for the backend API. Point this at your local backend during development (e.g. `http://localhost:3000/api/v1`). |
| `VITE_DEFAULT_CHAIN_ID` | Chain ID selected by default on load. `84532` is Base Sepolia, the recommended testnet. |
| `VITE_ANVIL_RPC_URL` | RPC URL for a local [Anvil](https://book.getfoundry.sh/anvil/) node (chain `31337`), used when developing against a local chain. |
| `VITE_BASE_SEPOLIA_RPC_URL` | RPC URL for the Base Sepolia testnet (chain `84532`). The public default `https://sepolia.base.org` works without an account. |

### Optional

| Variable | Description |
| --- | --- |
| `VITE_SEPOLIA_RPC_URL` | RPC URL for the Ethereum Sepolia testnet (chain `11155111`). Only needed when testing on Sepolia. |
| `VITE_MAINNET_RPC_URL` | RPC URL for Ethereum mainnet (chain `1`). Only needed when testing against mainnet. |
| `VITE_UTM_SOURCE`, `VITE_UTM_MEDIUM`, `VITE_UTM_CAMPAIGN`, `VITE_UTM_TERM`, `VITE_UTM_CONTENT` | UTM parameters appended to shared profile links. Leave blank to disable UTM tracking. |

### Where to get testnet RPC URLs

- **Base Sepolia** — the public endpoint `https://sepolia.base.org` is preconfigured and
needs no account. For higher rate limits, create a free Base Sepolia endpoint at
[Alchemy](https://www.alchemy.com/) or [Infura](https://www.infura.io/).
- **Ethereum Sepolia** — create a free Sepolia endpoint at
[Alchemy](https://www.alchemy.com/) or [Infura](https://www.infura.io/), or use a public
endpoint from [Chainlist](https://chainlist.org/?testnets=true&search=sepolia).
- **Local Anvil** — no URL to fetch; run `anvil` from [Foundry](https://book.getfoundry.sh/)
and it serves the default `http://127.0.0.1:8545`.

## Verification commands

Run these before opening a pull request:
Expand Down
Loading