
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
wrangler-proxy
Advanced tools
Wrangler Proxy for your favorite frameworks. Compatible with DrizzleORM
Wrangler Proxy exposes Workers API to outside and integrate to your favorite frameworks. Compatible with DrizzleORM.
npm i -D wrangler-proxy
wrangler.tomlname = "worker"
compatibility_date = "2023-07-02"
[[d1_databases]]
binding = "D1"
database_name = "D1"
database_id = "<d1-id>"
[[kv_namespaces]]
binding = "KV"
id = "<kv-id>"
preview_id = "<same-kv-id-as-above>"
[[services]]
binding = "WORKER"
service = "<worker-name>"
environment = "production"
wrangler dev node_modules/wrangler-proxy/dist/worker.js --remote
wrangler dev node_modules/wrangler-proxy/dist/worker.js
// file: app.d.ts
declare global {
namespace App {
interface Locals {
D1: D1Database;
}
interface Platform {
env?: {
D1: D1Database;
};
}
}
}
export {};
// file: src/hooks.server.ts
import { connectD1 } from 'wrangler-proxy';
export const handle = ({ event, resolve }) => {
event.locals.D1 = event.platform?.env?.D1 ?? connectD1('D1');
// or connectD1('D1', { hostname: 'custom-host-name' });
// default hostname is `http://127.0.0.1:8787`
return resolve(event);
};
wrangler-proxy to expose workers APIInit worker
npm create cloudflare@2 - .
// file: src/index.ts
import { createWorker } from 'wrangler-proxy';
export default createWorker();
import { connectD1 } from 'wrangler-proxy';
| Function | Status |
|---|---|
prepare() | ✅ |
batch() | ✅ |
dump() | 😔 |
exec() | ✅ |
| Function | Status |
|---|---|
first() | ✅ |
run() | ✅ |
all() | ✅ |
raw() | ✅ |
bind() | ✅ |
import { connectServiceBinding } from 'wrangler-proxy';
| Function | Status |
|---|---|
fetch() | ✅ |
connect() | 😔 |
// app.d.ts
declare global {
namespace App {
interface Locals {
SB: Fetcher;
}
interface Platform {
env?: {
SB: Fetcher;
};
}
}
}
/// hooks.server.ts
import { connectServiceBinding } from 'wrangler-proxy';
export const handle = async ({ resolve, event }) => {
event.locals.SB = event.platform?.env?.SB ?? connectServiceBinding('SB');
return resolve(event);
};
event.locals.SB.fetch('http://whatever.fake/send');
http://whatever.fake is required as a dummy hostname. Without a dummy hostname the fetch will fail.
import { connectKV } from 'wrangler-proxy';
| Function | Status |
|---|---|
put() | 🤷 |
get() | ✅ |
getWithMetadata() | 🤷 |
delete() | ✅ |
list() | 🤷 |
import { connectR2 } from 'wrangler-proxy';
| Function | Status |
|---|---|
head() | 😔 |
get() | ✅ |
put() | ✅ |
createMultipartUpload() | 😔 |
resumeMultipartUpload() | 😔 |
delete() | ✅ |
list() | 😔 |
waitUntil// file: app.d.ts
namespace App {
interface Platform {
context: {
waitUntil(promise: Promise<any>): void;
};
}
}
// file: +page.server.ts
import { waitUntil } from 'wrangler-proxy';
export const actions = {
default: ({ locals, platform }) => {
waitUntil((async () => {})(), platform?.context);
return { message: 'success' };
},
};
If you find this project helpful, consider supporting it by
or
Your donation will help us implement your requested features faster.
FAQs
Wrangler Proxy for your favorite frameworks. Compatible with DrizzleORM
The npm package wrangler-proxy receives a total of 34 weekly downloads. As such, wrangler-proxy popularity was classified as not popular.
We found that wrangler-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.