Get up and running with TOWN Platform in under 10 minutes.
Before you begin, make sure you have:
Navigate to your Dashboard → API Keys to generate your credentials.
Important
Keep your API keys secure! Never commit them to version control or expose them in client-side code. Use environment variables to store your keys safely.
Choose your preferred programming language:
// Install the TOWN SDK
npm install @town-platform/sdk
// Initialize the client
import { TownClient } from '@town-platform/sdk';
const client = new TownClient({
apiKey: 'your_api_key_here',
environment: 'sandbox', // or 'production'
});
// Make your first API call
async function createTransaction() {
try {
const transaction = await client.fiero.transactions.create({
amount: 100_00,
currency: 'USD',
userId: 'user_123',
type: 'deposit',
});
console.log('Transaction created', transaction.id);
} catch (error) {
console.error('Error:', error.message);
}
}
createTransaction();Test your integration with a simple API call. If everything is configured correctly, you should receive a 200 OK response with transaction details.
curl https://api.town.dev/v1/transactions \
-H "Authorization: Bearer sk_sandbox_123" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"currency": "USD",
"userId": "user_123",
"type": "deposit"
}'If you receive an authentication error, double-check that you're using your sandbox secret key and that the environment is set to sandbox.