FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
lightweight
lightweightglimpse2-runbook-test
Remix of lightweight/glimpse2-runbook
Public
Like
glimpse2-runbook-test
Home
Code
8
_townie
13
backend
7
frontend
1
shared
1
.vtignore
README.md
deno.json
H
main.tsx
Branches
3
Pull requests
Remixes
History
Environment variables
5
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
/
backend
/
routes
/
glimpse
/
README.md
Code
/
backend
/
routes
/
glimpse
/
README.md
Search
9/4/2025
README.md

Glimpse Routes

This directory contains routes for the glimpse functionality.

Routes

GET /:id

  • Purpose: Returns Notion page data as JSON with related content (filtered for data consumption)
  • Authentication: Required (Google OAuth)
  • Parameters: id - Notion page ID
  • Response: Service response object with Notion page data and related content
  • Filtering: Removes UI-specific properties (type: "button") for cleaner data consumption

Enhanced Functionality

The endpoint now fetches and includes related pages from the "Glimpse content" relation property:

  1. Main Page: Returns the requested page with filtered properties
  2. Related Content: Fetches all pages referenced in the "Glimpse content" relation
  3. Content Blocks: Includes full page blocks/content for each related page with nested blocks recursively fetched
  4. Nested Content: Supports callouts, code blocks, lists, tables, columns, and other nested block structures
  5. Sorting: Related pages are sorted by their "Order" property (ascending)
  6. Error Handling: Returns failure if main page OR any related page fails to fetch

Response Structure

{ "success": true, "data": { "id": "main-page-id", "properties": { ... }, // Main page properties (buttons filtered out) "glimpseContent": [ { "id": "related-page-1", "properties": { "Order": { "number": 1 }, ... }, // Related page properties (buttons filtered out) "blocks": [ ... ] // Full page content blocks with nested structures (callouts, lists, tables, etc.) }, { "id": "related-page-2", "properties": { "Order": { "number": 2 }, ... }, "blocks": [ ... ] // Full page content blocks with nested structures } ] }, "timestamp": "2025-07-27T12:00:00.000Z" }

Nested Block Structure

Blocks with children will have a children property containing their nested blocks:

{ "type": "bulleted_list_item", "bulleted_list_item": { ... }, "has_children": true, "children": [ { "type": "bulleted_list_item", "bulleted_list_item": { ... }, "has_children": false } ] }

Error Cases

  • Main page not found: Returns {success: false, error: "...", timestamp: "..."}
  • Related page fetch fails: Returns {success: false, error: "Failed to fetch related pages", timestamp: "..."}
  • Individual block children fail: Logs warning, continues with empty children array
  • No related content: Returns successful response with empty glimpseContent array

This is the same functionality as /views/glimpse/:id but mounted at /glimpse/:id for convenience.

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.