/Knowledge/sources/honojs__hono/examples/stytch-auth-api-todoapi-ts--part-02--2fcf588e1354.md

Example: stytch-auth/api/TodoAPI.ts (part 02) - hono-docs

Example: stytch auth/api/TodoAPI.ts (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://raw.githubusercontent.com/honoj...

Example: stytch-auth/api/TodoAPI.ts (part 02)

Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://raw.githubusercontent.com/honojs/examples/main/stytch-auth/api/TodoAPI.ts

Summary

// The Session JWT is a cached value and can be stale. For more dangerous operations like writes // we can check against the Stytch servers for the most up-to-date information .post('/todos', Consumer.authenticateSessionRemote(), async (...

Content

// The Session JWT is a cached value and can be stale. For more dangerous operations like writes // we can check against the Stytch servers for the most up-to-date information .post('/todos', Consumer.authenticateSessionRemote(), async (c) => { const newTodo = await c.req.json<{ todoText: string }>(); const {user_id} = Consumer.getStytchSession(c) const todos = await todoService(c.env, user_id).add(newTodo.todoText) return c.json({todos}) })

.post('/todos/:id/complete', Consumer.authenticateSessionRemote(), async (c) => { const {user_id} = Consumer.getStytchSession(c) const todos = await todoService(c.env, user_id).markCompleted(c.req.param().id) return c.json({todos}) })

Metadata

{
  "chunk_index": 1,
  "citation": "https://raw.githubusercontent.com/honojs/examples/main/stytch-auth/api/TodoAPI.ts",
  "coverage_role": "examples",
  "qualified_title": "Hono / examples / stytch-auth/api/TodoAPI.ts (2)",
  "repo_path": "stytch-auth/api/TodoAPI.ts",
  "retrieved_at": "2026-07-02T05:51:01Z",
  "section_index": 0,
  "source_id": "/honojs/hono",
  "source_type": "examples",
  "target_label": "examples",
  "title": "Example: stytch-auth/api/TodoAPI.ts (part 02)",
  "upstream_url": "https://raw.githubusercontent.com/honojs/examples/main/stytch-auth/api/TodoAPI.ts",
  "version": "2026"
}
Example: stytch-auth/api/TodoAPI.ts (part 02) - hono-docs