• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
lightweight

lightweight

glimpse2-runbook-scaffold-auth-webhooks-view

Unlisted
Like
glimpse2-runbook-scaffold-auth-webhooks-view
Home
Code
8
_townie
13
backend
7
frontend
1
shared
1
.vtignore
README.md
deno.json
H
main.tsx
Branches
5
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
/
Code
/
Search
main.tsx
https://lightweight--01989ea8a08476a99edf1a65b50dd1cd.web.val.run
README.md

Glance Demos

A Val Town application for managing and viewing demos with authentication.

Features

  • Authentication: Google OAuth via LastLogin
  • Dashboard: User-friendly interface showing system status
  • Health Monitoring: Real-time system health checks
  • Modular Architecture: Clean separation of concerns

Authentication

This application uses LastLogin for authentication:

  • Login: Users sign in with their Google account
  • Protected Routes: All routes require authentication except public endpoints
  • Logout: Users can logout via /auth/logout (handled automatically by LastLogin)
  • Session Management: Automatic session validation and renewal

Public Routes

The following routes are accessible without authentication:

  • /api/health - System health status

Protected Routes

Routes are protected by different authentication mechanisms:

User Authentication (Google OAuth via LastLogin):

  • / - Main dashboard (shows user info and system status)
  • /api/* - API endpoints (except health)
  • /views/* - View routes

Webhook Authentication (X-API-KEY header):

  • /tasks/* - Webhook endpoints for external integrations (POST requests only)
    • GET requests to /tasks/* are allowed without authentication for debug endpoints

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/         # Business logic controllers
β”‚   β”œβ”€β”€ routes/             # Route definitions
β”‚   β”‚   β”œβ”€β”€ api/            # API endpoints
β”‚   β”‚   β”œβ”€β”€ tasks/          # Task-related routes
β”‚   β”‚   β”œβ”€β”€ views/          # User-facing views
β”‚   β”‚   └── authCheck.ts    # Authentication middleware
β”‚   └── services/           # External service integrations
β”œβ”€β”€ frontend/               # Frontend assets
β”œβ”€β”€ shared/                 # Shared utilities
└── main.tsx               # Application entry point

Development

The application is built with:

  • Hono: Web framework for routing and middleware
  • LastLogin: Authentication service
  • TypeScript: Type-safe development
  • Val Town: Hosting platform

Webhook Authentication

The application supports webhook endpoints for external integrations (like Notion webhooks):

Configuration

Set the webhook secret in your environment:

NOTION_WEBHOOK_SECRET=your-secret-key-here

Webhook Endpoints

  • POST /tasks/notion-webhook - Main webhook endpoint for Notion integrations
  • POST /tasks/test - Test endpoint for webhook authentication
  • GET /tasks/debug-webhook - Debug endpoint to check webhook configuration

Authentication

Webhook endpoints require the X-API-KEY header:

curl -X POST https://your-val.web.val.run/tasks/test \ -H "X-API-KEY: your-secret-key-here"

Testing

Use the webhook testing form in the dashboard:

  1. Navigate to your dashboard at /
  2. Find the "Webhook Endpoint" section
  3. Enter your NOTION_WEBHOOK_SECRET value
  4. Click "Test Webhook" to verify authentication

Environment Variables

Configure these environment variables for full functionality:

  • GLANCE_DEMOS_DB_ID - Notion database ID for demos
  • GLANCE_CONTENT_DB_ID - Notion database ID for content
  • GLANCE_INTERACTIONS_DB_ID - Notion database ID for interactions
  • NOTION_API_KEY - Notion API key for database access
  • NOTION_WEBHOOK_SECRET - Secret key for webhook authentication
Code
_towniebackendfrontendshared.vtignoreREADME.mddeno.json
H
main.tsx
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.