Skip to content

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 ​

ParameterTypeDescription
apiTokenstringYour Urban Sky API token

Optional Parameters ​

ParameterTypeDefaultDescription
baseUrlstring'https://api.ops.atmosys.com'Custom API URL (rarely needed)
debugbooleanfalseEnable debug logging
reconnectbooleantrueEnable automatic reconnection
reconnectDelaynumber5000Delay between reconnection attempts (ms)
maxReconnectAttemptsnumber10Maximum reconnection attempts
connectionTimeoutnumber30000Connection timeout (ms)
heartbeatIntervalnumber30000Heartbeat 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 deployment

JavaScript 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: