Skip to content

Getting Started

This guide walks you through account creation, workspace setup, API key generation, and sending your first log entry.

1. Create an Account

Register with email and password:

bash
curl -X POST https://api.logvista.orph.dev/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-secure-password",
    "name": "Your Name"
  }'
json
{
  "success": true,
  "data": {
    "user": { "id": "usr_abc123", "email": "you@example.com", "name": "Your Name" },
    "accessToken": "eyJ...",
    "refreshToken": "rt_...",
    "personalWorkspace": { "id": "ws_...", "slug": "your-name" }
  },
  "error": null,
  "meta": { "timestamp": "2026-03-07T12:00:00.000Z" }
}

A personal workspace is created automatically. Check your email to verify your address.

Alternative sign-in methods

You can also sign in via magic link, GitHub OAuth, or Google OAuth. New users are auto-registered on first OAuth or magic link sign-in.

2. Create a Project

Every log belongs to a project within a workspace. Create one using your JWT access token:

bash
curl -X POST https://api.logvista.orph.dev/projects \
  -H "Authorization: Bearer eyJ..." \
  -H "X-Workspace-Id: ws_your_workspace_id" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My App" }'

3. Generate an API Key

Create a workspace API key with write access for log ingestion:

bash
curl -X POST https://api.logvista.orph.dev/projects/proj_id/keys \
  -H "Authorization: Bearer eyJ..." \
  -H "X-Workspace-Id: ws_your_workspace_id" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-ingest",
    "scopes": ["logs:write"]
  }'

One-time display

The API key (sk_...) is shown only once at creation time. It is stored as a SHA-256 hash on the server. If lost, revoke the key and create a new one.

4. Install the Client SDK

bash
bun add @orphnet/logging-api-client

5. Send Your First Log

Try it now

Send a log to the sandbox environment — no setup required:

With Hono Middleware

The fastest way to start logging. Every HTTP request is automatically captured:

typescript
import { Hono } from 'hono'
import { createLoggingMiddleware } from '@orphnet/logging-api-client'

const app = new Hono()

app.use('*', createLoggingMiddleware({
  apiUrl: 'https://api.logvista.orph.dev',
  apiKey: 'sk_your_api_key',
}))

app.get('/', (c) => c.text('Hello'))

export default app

With FetchTransport (Any Runtime)

Use the standalone logger for non-Hono applications:

typescript
import { createLogger, FetchTransport } from '@orphnet/logging-api-client'

const transport = new FetchTransport({
  apiUrl: 'https://api.logvista.orph.dev',
  apiKey: 'sk_your_api_key',
})

const logger = createLogger(transport, 'project-id', 'session-id')

logger.system('info', { message: 'Application started' })
logger.ai('inference', { message: 'Model called', data: { model: 'claude-3' } })

With BatchTransport (High-Throughput)

Queue logs and flush in batches to reduce HTTP requests:

typescript
import { createLogger, BatchTransport } from '@orphnet/logging-api-client'

const transport = new BatchTransport({
  apiUrl: 'https://api.logvista.orph.dev',
  apiKey: 'sk_your_api_key',
  maxBatchSize: 25,
  flushIntervalMs: 5000,
})

const logger = createLogger(transport, 'project-id', 'session-id')

logger.http('request', { message: 'Upstream API called' })
logger.http('response', { message: 'Got 200 OK', data: { latency: 120 } })

// Flush remaining logs before shutdown
process.on('SIGTERM', () => transport.dispose())

6. Query Your Logs

Retrieve logs for a project:

bash
curl -X POST https://api.logvista.orph.dev/logger/query \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": { "level": "info" },
    "pagination": { "offset": 0, "limit": 20 }
  }'

Try it now

Query the sandbox logs — if you ingested a log above, it should appear here (may take ~60s for queue processing):

The API automatically routes to KV for recent data or D1 for older logs. See Backends for details on query routing.

Next Steps

LogVista — Edge-native structured logging API