Search
Star
Feedback
Setup for Free
Β© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Accessing D1 outside of a request in an Astro app - Cloudflare Developers
CD
Cloudflare Developers
β’
12mo ago
β’
1 reply
danβ1106
Accessing D1 outside of a request in an Astro app
I
'm using astro
-auth
[1
] in an on
-demand rendered app
, using adapter
-cloudflare
[2
] to deploy to Cloudflare workers
.
My auth
.config
.ts file exists outside of a request
, so I can
't access my D1 database
(context
.locals
.runtime
.env
.DB
)
Is it possible to access the Cloudflare runtime outside of a request
? If not
, any tips on how to initialize astro
-auth in middleware
?
[1
]
https://github.com/nowaythatworked/auth-astro
[2
]
https://docs.astro.build/en/guides/integrations-guide/cloudflare/
GitHub
GitHub - nowaythatworked/auth-astro: Community maintained Astro int...
Community maintained Astro integration of
@auth
/core
- nowaythatworked
/auth
-astro
Docs
@astrojs/cloudflare
Learn how to use the
@astrojs
/cloudflare SSR adapter to deploy your Astro project
.
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Access D1 database outside a request
CD
Cloudflare Developers / workers-and-pages-help
2y ago
Help setting up an Astro app alongside a cron trigger
CD
Cloudflare Developers / workers-and-pages-help
7mo ago
Accessing the request from McpAgent
CD
Cloudflare Developers / workers-and-pages-help
7mo ago
Accessing files in a worker
CD
Cloudflare Developers / workers-and-pages-help
2y ago