FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
curtcox
curtcoxLogfireViewer
Public
Like
LogfireViewer
Home
Code
7
README.md
H
logfire-proxy-debug.ts
H
logfire-proxy-minimal.ts
H
logfire-proxy.ts
H
test-cookies.ts
H
test-hono.ts
H
test-simple.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
https://curtcox--4a5de5d8890011f0aa870224a6c84d84.web.val.run
README.md

LogFire Query Proxy

A proxy service for querying the LogFire API with a user-friendly web interface and direct API access.

Features

  • Web Interface: User-friendly form for building and executing LogFire queries
  • Direct API Access: Support for query parameters and form data for programmatic access
  • Token Management: Automatically stores read tokens in cookies for convenience
  • Multiple Response Formats: Support for JSON, CSV, and Apache Arrow formats
  • Parameter Validation: Ensures required parameters are provided before making requests
  • Error Handling: Clear error messages and form validation

Usage

Web Interface

Visit the proxy URL in your browser to access the web form:

  • Fill in your LogFire read token
  • Enter your SQL query
  • Optionally set timestamps, limits, and response format
  • Click "Execute Query" to run the query

Direct API Access

You can make direct requests to the proxy using query parameters or form data.

GET Request with Query Parameters

curl "https://your-proxy-url/?read-token=YOUR_TOKEN&sql=SELECT%20*%20FROM%20records%20LIMIT%2010"

POST Request with Form Data

curl -X POST https://your-proxy-url/ \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "read_token=YOUR_TOKEN&sql=SELECT * FROM records LIMIT 10&accept=application/json"

POST Request with JSON (via query params)

curl -X POST https://your-proxy-url/?read-token=YOUR_TOKEN&sql=SELECT%20*%20FROM%20records \ -H "Accept: text/csv"

Parameters

Required Parameters

  • read_token / read-token: Your LogFire read token (required)
  • sql: The SQL query to execute (required)

Optional Parameters

  • min_timestamp: ISO format timestamp for filtering records
  • max_timestamp: ISO format timestamp for filtering records
  • limit: Number of rows to return (default: 500, max: 10,000)
  • row_oriented: Set to "true" for row-oriented JSON responses
  • accept: Response format (application/json, text/csv, or application/vnd.apache.arrow.stream)

Special Parameters

  • edit=true: Forces the web form to display even if all required parameters are present

Token Storage

The proxy automatically stores your read token in a secure HTTP-only cookie that lasts for 30 days. This means:

  • You only need to enter your token once
  • The token is stored securely and not accessible to client-side JavaScript
  • Subsequent requests will automatically use the stored token

Response Formats

JSON (default)

  • Column-oriented by default
  • Set row_oriented=true for row-oriented format

CSV

  • Set Accept: text/csv header or accept=text/csv parameter

Apache Arrow

  • Set Accept: application/vnd.apache.arrow.stream header or accept=application/vnd.apache.arrow.stream parameter

Error Handling

  • Missing required parameters will show the web form with error messages
  • Invalid tokens or SQL queries will return the LogFire API error response
  • Network errors are displayed in the web interface

CORS Support

The proxy includes full CORS support, allowing it to be used from web applications running on different domains.

Examples

Basic Query

GET /?read-token=your_token&sql=SELECT COUNT(*) FROM records

Query with Timestamp Filter

GET /?read-token=your_token&sql=SELECT * FROM records&min_timestamp=2024-01-01T00:00:00Z&limit=100

CSV Export

GET /?read-token=your_token&sql=SELECT * FROM records LIMIT 1000&accept=text/csv

Force Edit Mode

GET /?edit=true&read-token=existing_token&sql=SELECT * FROM records
HTTP
  • logfire-proxy-debug.ts
    curtcox--4a…84.web.val.run
  • logfire-proxy-minimal.ts
    curtcox--2f…84.web.val.run
  • logfire-proxy.ts
    curtcox--cbe45786880b11f098ab0224a6c84d84.web.val.run
  • test-cookies.ts
    curtcox--26…84.web.val.run
  • test-hono.ts
    curtcox--1e…84.web.val.run
  • test-simple.ts
    curtcox--16…84.web.val.run
Code
README.md
H
logfire-proxy-debug.ts
H
logfire-proxy-minimal.ts
H
logfire-proxy.ts
H
test-cookies.ts
H
test-hono.ts
H
test-simple.ts
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.