The EdgeSpark runtime gives your server code a typed SDK for platform services. You import what you need fromDocumentation Index
Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt
Use this file to discover all available pages before exploring further.
edgespark and edgespark/http, then use those values inside route handlers.
This page is about the server runtime. For browser code in the scaffolded web/ app, use @edgespark/web.
Runtime pattern
Your entry point exports a static Hono app:server/src/index.ts
Client shape
The runtime is split into focused imports:dbfromedgesparkfor Drizzle database accessstoragefromedgesparkfor R2 operationssecretfromedgesparkfor encrypted secretsvarsfromedgesparkfor plain environment variablesctxfromedgesparkfor request-scoped helpers such asrunInBackground()andenvironmentauthfromedgespark/httpfor the current authenticated user and auth helpers
db
A Drizzle ORM instance connected to your project’s D1 database:
auth
Authentication state for the current request:
/api/* require login. Routes under /api/public/* allow anonymous access. See path-based auth.
storage
Typed access to your declared buckets:
secret
Reads environment-scoped secrets:
vars
Reads plain runtime configuration:
ctx
Request-scoped helpers:
Generated types
The runtime SDK is typed from generated files inserver/src/__generated__/. Run edgespark pull types whenever you need to refresh those declarations.
See also
SDK overview
The full SDK reference index for database, auth, storage, secrets, and context.
Project structure
Where generated types and repo-authored defs live in the scaffold.