Getting Started

Orion is a monitoring and logging platform. This guide covers the fastest path to sending your first log.

Install the SDK

npm install orion-monitoring

Requirements: Node.js 18+. The SDK uses native fetch — no polyfills needed.

Initialize your project

The CLI scaffolds a .orion/config.json file with your project token:

npx @orion-monitoring/cli

The wizard will:

  1. Sign in to your Orion account
  2. Let you select or create a project and source
  3. Write .orion/config.json to your project root

Send your first log

import { createLogger } from 'orion-monitoring'

const logger = createLogger()

logger.info('Server started')
logger.warn('High memory usage', { memoryMb: 512 })
logger.error('Database connection failed', { host: 'db.example.com' })

createLogger() auto-detects .orion/config.json by walking up from the calling file's directory.

Manual configuration

Skip the CLI and pass config directly:

import { createLogger } from 'orion-monitoring'

const logger = createLogger({
  token: 'your-source-token',
  apiUrl: 'https://api.yourinstance.com/api', // defaults to http://localhost:3001/api
})

Graceful shutdown

The SDK queues logs when the API is offline and retries every 30 seconds. Call close() on shutdown to flush:

process.on('SIGTERM', () => {
  logger.close()
  process.exit(0)
})

Next steps