This guide provides detailed instructions for setting up your .dev.vars file for local development.
First, copy the sample environment file:
cp .env.sample .dev.varsThen, edit the .dev.vars file to set the required values as described below.
| Variable | Description | Example Value |
|---|---|---|
OP_KEY_ID |
UUID v4 identifier for your Open Payments key. | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
OP_PRIVATE_KEY |
Base64-encoded private key for signing requests. | (See conversion script below) |
OP_WALLET_ADDRESS |
The URL of your Open Payments wallet address. | https://ilp.interledger-test.dev/my-wallet |
AWS_ACCESS_KEY_ID |
AWS access key for S3. Not used in local dev. | ABCDEFGHIJKLMN12OPQR |
AWS_SECRET_ACCESS_KEY |
AWS secret key for S3. Not used in local dev. | ab1cD/2e/fGhIJ11kL13mN0pQrS45tu6V7w8X9yZ |
AWS_S3_ENDPOINT |
The endpoint for the S3-compatible storage. | http://localhost:8081 |
UMAMI_HOST |
URL of your Umami instance. | http://localhost:3001 |
UMAMI_WEBSITE_ID |
Website ID from the Umami dashboard. | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
These variables are required to connect to an Interledger wallet for handling payments. For development, you can use the Interledger Testnet.
This is the unique identifier for your API key.
- Sign up for an Interledger Testnet wallet.
- In your wallet dashboard, navigate to the Settings section from the side menu and access developer keys.
- Generate a new key pair.
- Copy the Key ID (which is in UUID format) and paste it into your
.dev.varsfile.
This is the secret key used to sign payment requests, proving you own the wallet.
- When you generate a key pair, your wallet will provide a private key.
- Important: This key needs to be converted to a specific format. Use the script below to do this.
Security Note: Never commit this value to version control.
Click to see Private Key Conversion Script
After copying your private key, run this script to convert it to the correct format.
Replace currentKey value string with your copied private key, then use the output as your OP_PRIVATE_KEY value:
// paste your private key from the wallet here
const currentKey = ''
const derBytes = atob(
currentKey
.replace('-----BEGIN PRIVATE KEY-----', '')
.replace('-----END PRIVATE KEY-----', '')
.replace(/\s/g, ''),
)
const bytes = new Uint8Array(derBytes.length)
for (let i = 0; i < derBytes.length; i++) {
bytes[i] = derBytes.charCodeAt(i)
}
const privateKey = bytes.slice(-32)
const keyBase64 = btoa(String.fromCharCode(...privateKey))
console.log('Your new OP_PRIVATE_KEY is:')
console.log(keyBase64)This is the public address of your wallet where you can receive payments.
- In your Interledger wallet dashboard, find your payment pointer. It will look something like
$ilp.interledger-test.dev/my-wallet. - To get the wallet address, simply replace the
$withhttps://.
For example, if your payment pointer is $ilp.interledger-test.dev/alice, your OP_WALLET_ADDRESS would be https://ilp.interledger-test.dev/alice.
These variables are for connecting to an S3 bucket, which is used to store the configuration for the publisher tools. For local development, a simulated S3 service is used, so you don't need real AWS credentials.
For local development, these values are ignored by the local S3 simulator. You can leave the default values from .env.sample as they are.
For Development: Use the local S3 simulator, which runs on http://localhost:8081. This should be the default value in your .dev.vars.
AWS_S3_ENDPOINT="http://localhost:8081"
For Production: Use your actual S3 bucket endpoint, this would be the URL of your actual S3 bucket endpoint.
AWS_S3_ENDPOINT="https://your-bucket-name.s3.your-region.amazonaws.com"
How to get real AWS keys (for production use)
- Sign in to the AWS Management Console
- Navigate to IAM (Identity and Access Management)
- In the left sidebar, select "Users"
- Click on your user or create a new user with S3 permissions
- Go to the "Security credentials" tab
- Scroll down to "Access keys" and click "Create access key"
- Choose "Application running outside AWS"
- Copy the Access key ID Make sure to save both the Access Key ID and Secret Access Key when they are displayed, as AWS will not show the secret key again.
Required Permissions: S3 read/write access
Security Note: Never commit this value to version control
Optional. If unset, the analytics script is silently skipped. For local dev, start the Umami instance first:
cd localenv/umami && docker compose up -dThen log in at http://localhost:3001 (default credentials: admin / umami), go to Settings → Websites → Add website, and copy the Website ID.
UMAMI_HOST="http://localhost:3001"
UMAMI_WEBSITE_ID="<your-website-id>"
- Uses local S3 simulation via
localenv/s3 - Uses Interledger testnet for payments
- Safe for testing and development
- Requires actual AWS S3 bucket
- Uses live payment networks
- Requires proper security measures
- "OP_KEY_ID not found": Ensure your key ID is a valid UUID v4 format
- "Invalid private key": Verify the private key is properly base64-encoded
- "AWS access denied": Check that your IAM user has the necessary S3 permissions
- "Connection refused to localhost:8081": Make sure the local S3 service is running (
pnpm -C localenv/s3 dev)
After setting up your .dev.vars, you can test your configuration by running:
pnpm -r --parallel devOpen the application on localhost:3000 try to use features or trigger configuration storage
- Check the main README.md for general setup instructions
- Review the contribution guidelines
- For Web Monetization questions, visit webmonetization.org
- For Interledger information, see interledger.org