Appearance
Configuration
Overview
The Urban Sky SDK is designed to work with minimal configuration. Most options have sensible defaults, and you typically only need to provide your API token.
Basic Configuration
Required Parameters
| Parameter | Type | Description |
|---|---|---|
apiToken | string | Your Urban Sky API token |
Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
baseUrl | string | 'https://api.ops.atmosys.com' | Custom API URL (rarely needed) |
debug | boolean | false | Enable debug logging |
reconnect | boolean | true | Enable automatic reconnection |
reconnectDelay | number | 5000 | Delay between reconnection attempts (ms) |
maxReconnectAttempts | number | 10 | Maximum reconnection attempts |
connectionTimeout | number | 30000 | Connection timeout (ms) |
heartbeatInterval | number | 30000 | Heartbeat interval (ms) |
Usage Examples
JavaScript
javascript
const sdk = await UrbanSkySDK.init({
apiToken: 'your-api-token'
// baseUrl: 'custom-api-url' // Optional: only needed for custom deployments
})Python
python
sdk = await UrbanSkySDK.init({
'apiToken': 'your-api-token'
# 'baseUrl': 'custom-api-url' # Optional: only needed for custom deployments
})Environment Variables
Use environment variables to keep your configuration secure and flexible:
bash
# .env file
URBAN_SKY_API_TOKEN=your-api-token
URBAN_SKY_API_URL=https://api.ops.atmosys.com # Optional: only if using custom deploymentJavaScript with Environment Variables
javascript
const sdk = await UrbanSkySDK.init({
apiToken: process.env.URBAN_SKY_API_TOKEN,
baseUrl: process.env.URBAN_SKY_API_URL // Optional
})Python with Environment Variables
python
import os
sdk = await UrbanSkySDK.init({
'apiToken': os.getenv('URBAN_SKY_API_TOKEN'),
'baseUrl': os.getenv('URBAN_SKY_API_URL') # Optional
})Complete Configuration Example
Most users won't need to customize these options, but here's a complete example:
javascript
const sdk = await UrbanSkySDK.init({
// Required
apiToken: process.env.URBAN_SKY_API_TOKEN,
// Optional (most users don't need these)
baseUrl: process.env.URBAN_SKY_API_URL, // Only for custom deployments
debug: process.env.NODE_ENV === 'development',
reconnect: true,
reconnectDelay: 5000,
maxReconnectAttempts: 10,
connectionTimeout: 30000,
heartbeatInterval: 30000
})Troubleshooting Configuration
Common Issues
"API endpoint not accessible"
- Verify your network connection
- Ensure you're using the correct API URL (most users should use the default)
"Invalid configuration"
- Check that your API token is correct
- Verify all parameter types match the expected values
Next Steps:
- Authentication Guide - Getting API tokens
- Error Handling - Handling connection issues