[GH-ISSUE #225] What's the equivalent of getCloudflareContext? #54

Closed
opened 2026-05-06 12:36:51 +02:00 by BreizhHardware · 1 comment

Originally created by @mofax on GitHub (Mar 2, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/225

Opennext supports access to worker bindings via

import { getCloudflareContext } from "@opennextjs/cloudflare";
// For example, to use Hyperdrive
const context = getCloudflareContext();
return postgres(context.env.HYPERDRIVE.connectionString);

What is the equivalent for this in vinext?

Originally created by @mofax on GitHub (Mar 2, 2026). Original GitHub issue: https://github.com/cloudflare/vinext/issues/225 Opennext supports access to worker bindings via ```ts import { getCloudflareContext } from "@opennextjs/cloudflare"; ``` ```ts // For example, to use Hyperdrive const context = getCloudflareContext(); return postgres(context.env.HYPERDRIVE.connectionString); ``` What is the equivalent for this in vinext?
Author
Owner

@southpolesteve commented on GitHub (Mar 3, 2026):

Good news! Don't need that anymore. You can import them directly from env just like any other worker. No special getCloudflareContext. Added to the README today: https://github.com/cloudflare/vinext#cloudflare-bindings-d1-r2-kv-ai-etc

<!-- gh-comment-id:3988458616 --> @southpolesteve commented on GitHub (Mar 3, 2026): Good news! Don't need that anymore. You can import them directly from env just like any other worker. No special `getCloudflareContext`. Added to the README today: https://github.com/cloudflare/vinext#cloudflare-bindings-d1-r2-kv-ai-etc
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#54
No description provided.