π§ͺ Staging Integration Guide
Test your integration safely before going live β no risk, no billing, full API
What is the Staging Environment?
Staging is a fully functional copy of the SoWasIt API, dedicated to testing your integration before connecting to production. You can create chains, add blocks, test your webhooks and API keys β all for free, with no impact on your production data.
| Feature | Staging | Production |
|---|---|---|
| API URL | api.staging.sowasit.io | api.sowasit.io |
| Billing | β Always free | Per plan |
| Stripe | β Test mode only | Live mode |
| Data retention | β οΈ Deleted after 30 days | β Permanent |
| Rate limits | Relaxed | Per plan |
Quick Start (3 minutes)
1. Create a free account on staging
Sign up at the staging URL below. Your staging account is separate from your production account.
2. Generate an API key
Go to Dashboard β API Keys β Create key. Copy your staging API key β it will only be shown once.
3. Make your first API call
Create your first chain:
curl https://api.staging.sowasit.io/chains \
-H "X-API-Key: YOUR_STAGING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"my-first-chain","name":"My First Chain"}'That's it. You now have a blockchain chain on staging. Add blocks, test webhooks, build your integration.
Code Examples
The only thing that changes between staging and production is the base URL and your API key. Here are ready-to-use examples:
cURL
# Create a chain
curl -X POST https://api.staging.sowasit.io/chains \
-H "X-API-Key: YOUR_STAGING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"my-chain","name":"My Chain","visibility":"private"}'
# Add a block
curl -X POST https://api.staging.sowasit.io/chains/my-chain/blocks \
-H "X-API-Key: YOUR_STAGING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"event":"user_signed","userId":"u_123","timestamp":"2025-01-15T10:00:00Z"}}'
# Read blocks
curl https://api.staging.sowasit.io/chains/my-chain/blocks \
-H "X-API-Key: YOUR_STAGING_API_KEY"JavaScript / Node.js
const API_KEY = 'YOUR_STAGING_API_KEY';
const BASE_URL = 'https://api.staging.sowasit.io';
const headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json',
};
// Create a chain
await fetch(`${BASE_URL}/chains`, {
method: 'POST',
headers,
body: JSON.stringify({ id: 'my-chain', name: 'My Chain' }),
});
// Add a block
const res = await fetch(`${BASE_URL}/chains/my-chain/blocks`, {
method: 'POST',
headers,
body: JSON.stringify({ data: { event: 'user_signed', userId: 'u_123' } }),
});
const block = await res.json();
console.log('Block hash:', block.hash);Python
import requests
API_KEY = 'YOUR_STAGING_API_KEY'
BASE_URL = 'https://api.staging.sowasit.io'
headers = {'X-API-Key': API_KEY, 'Content-Type': 'application/json'}
# Create a chain
requests.post(f'{BASE_URL}/chains', json={'id': 'my-chain', 'name': 'My Chain'}, headers=headers)
# Add a block
res = requests.post(
f'{BASE_URL}/chains/my-chain/blocks',
json={'data': {'event': 'user_signed', 'userId': 'u_123'}},
headers=headers
)
print('Block hash:', res.json()['hash'])Data Retention Policy
Staging data is automatically cleaned every night at 02:00 UTC. This keeps the environment lean and free for everyone.
| Data type | Retention |
|---|---|
| Private chains + blocks | β³ 30 days |
| Public chains (non-anchoring) + blocks | β³ 30 days |
| Anchoring chains | β³ 1 year |
| Sessions | On expiry |
Need a clean slate? You can delete your chains manually at any time from the dashboard, or simply wait for the nightly cleanup.
Going to Production
Migrating from staging to production requires exactly two changes in your code:
The two changes
1. Change the API base URL
# Staging
const BASE_URL = 'https://api.staging.sowasit.io';
# Production
const BASE_URL = 'https://api.sowasit.io';That's the only URL change needed. All endpoints, paths and parameters stay the same.
2. Use your production API key
Create a new API key in your production dashboard (sowasit.io β Dashboard β API Keys). Do not reuse your staging key β staging and production keys are separate.
Pre-launch checklist
- β All API calls return the expected responses on staging
- β Webhook endpoints are validated and receiving events
- β Error handling tested (invalid key, quota exceeded, etc.)
- β Production API key created and stored securely
- β Base URL updated to api.sowasit.io