- the server runtime imports from
edgesparkandedgespark/http - the browser SDK from
@edgespark/web
Main runtime imports
server/src/index.ts
server/src/__generated__/.
Import contract
The public server runtime import contract is:Example server route
server/src/index.ts
Modules
web
The browser SDK for auth, managed auth UI, and same-origin API calls.
db
Query your D1 database with Drizzle ORM.
auth
Access the current user and session.
storage
Upload, download, and manage files in R2.
secret
Read encrypted secrets by name.
vars
Read plain runtime variables by key.
ctx
Use ctx for request-scoped helpers:
server/src/index.ts
Generated types
Runedgespark pull types to refresh the generated declarations for edgespark imports. Run edgespark pull types --check to detect stale types in CI or before deploy.
See also
The client object
Conceptual overview of the runtime SDK and how it is injected per request.
Project structure
Where generated files and repo-authored defs live in the scaffold.