This document provides detailed information about all environment variables used by the ATXP SDK.
Required for Solana payment operations
The RPC endpoint URL for the Solana network you want to use.
Type: String (URL)
Required: Yes (for Solana payments)
Default: None
Examples:
# Mainnet
SOLANA_ENDPOINT=https://api.mainnet-beta.solana.com
# Devnet
SOLANA_ENDPOINT=https://api.devnet.solana.com
# Testnet
SOLANA_ENDPOINT=https://api.testnet.solana.com
# Local development
SOLANA_ENDPOINT=http://localhost:8899Required for Solana payment operations
The private key for the Solana account that will be used for payments. Must be in base58 format.
Type: String (base58 encoded)
Required: Yes (for Solana payments)
Default: None
Example:
SOLANA_PRIVATE_KEY=4NwwCq5NpFNiJsQdujqvHKndryLPXfcE5xytJP7mKTxP...Security Note: Never commit private keys to version control. Use environment variables or secure secret management systems.
Controls the behavior of the SDK based on the environment.
Type: String
Required: No
Default: development
Values: development, production, test
Effects:
development: Enables development features like HTTP requests, detailed loggingproduction: Enforces HTTPS, production security settings, minimal loggingtest: Optimized for testing environment
Example:
NODE_ENV=productionEnables debug logging when set to any value.
Type: String
Required: No
Default: Not set
Example:
DEBUG=1
# or
DEBUG=true
# or
DEBUG=atxp:*# .env file for development
NODE_ENV=development
DEBUG=1
SOLANA_ENDPOINT=https://api.devnet.solana.com
SOLANA_PRIVATE_KEY=your_devnet_private_key# .env file for production
NODE_ENV=production
SOLANA_ENDPOINT=https://api.mainnet-beta.solana.com
SOLANA_PRIVATE_KEY=your_mainnet_private_key# .env.test file
NODE_ENV=test
SOLANA_ENDPOINT=https://api.testnet.solana.com
SOLANA_PRIVATE_KEY=your_testnet_private_keyFor Vercel deployments, set environment variables in the Vercel dashboard:
- Go to your project in the Vercel dashboard
- Navigate to Settings → Environment Variables
- Add each required variable:
SOLANA_ENDPOINTSOLANA_PRIVATE_KEYNODE_ENV(set toproduction)
# Dockerfile example
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Set environment variables
ENV NODE_ENV=production
ENV SOLANA_ENDPOINT=https://api.mainnet-beta.solana.com
# Note: Set sensitive variables at runtime
# docker run -e SOLANA_PRIVATE_KEY=... your-app# kubernetes-deployment.yaml example
apiVersion: apps/v1
kind: Deployment
metadata:
name: atxp-app
spec:
template:
spec:
containers:
- name: atxp-app
image: your-app:latest
env:
- name: NODE_ENV
value: "production"
- name: SOLANA_ENDPOINT
value: "https://api.mainnet-beta.solana.com"
- name: SOLANA_PRIVATE_KEY
valueFrom:
secretKeyRef:
name: atxp-secrets
key: private-key-
"Invalid Solana endpoint"
- Ensure the SOLANA_ENDPOINT is a valid URL
- Check network connectivity to the endpoint
- Verify the endpoint is accessible from your deployment environment
-
"Invalid private key format"
- Ensure the private key is in base58 format
- Check that the key hasn't been corrupted or truncated
- Verify you're using the correct key for the intended network
You can validate your environment setup by running:
# Check if all required variables are set
node -e "
const required = ['SOLANA_ENDPOINT', 'SOLANA_PRIVATE_KEY'];
const missing = required.filter(key => !process.env[key]);
if (missing.length > 0) {
console.error('Missing required environment variables:', missing);
process.exit(1);
}
console.log('All required environment variables are set');
"-
Never commit secrets to version control
- Use
.envfiles (added to.gitignore) - Use platform-specific secret management
- Use Kubernetes secrets or Docker secrets
- Use
-
Use different tokens for different environments
- Development tokens for development
- Production tokens for production
- Test tokens for testing
-
Rotate tokens regularly
- Implement token rotation policies
- Monitor token usage and expiration
-
Limit token permissions
- Use tokens with minimal required permissions
- Avoid using admin tokens for application operations
-
Monitor and log
- Log authentication attempts
- Monitor for unusual token usage patterns
- Set up alerts for failed authentication