pinme-r2

Featured

Use when a PinMe Cloudflare Worker needs R2 object storage, including secure file or image upload, streaming download, metadata lookup, deletion, listing, Range requests, or R2+D1 coordination. Guides AI to use PinMe's automatically injected env.R2 binding without R2 credentials or manual Wrangler configuration.

DevOps & Infrastructure 3,724 stars 272 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PinMe Worker R2 Storage Use the project-scoped R2 bucket that PinMe binds to every deployed Worker as `env.R2`. Do not create credentials, choose a bucket name, or edit generated Wrangler configuration. ## Runtime Contract PinMe rebuilds trusted Worker metadata on create, save, and update. Client metadata cannot replace the R2 binding. | Binding | TypeScript type | Availability | | --- | --- | --- | | `DB` | `D1Database` | Always injected | | `R2` | `R2Bucket` | Always injected; current project's bucket | | `API_KEY` | `string` | Always injected | | `LLM_API_KEY` | `string` | Always injected | | `BASE_URL` | `string` | Always injected | | `WORKER_URL` | `string` | Always injected | | `PROJECT_NAME` | `string` | Always injected | Payment-specific bindings such as `UNIWEB_SECRET` are conditional and unrelated to R2 access. Declare only the bindings used by the Worker module. R2 code normally starts with: ```typescript export interface Env { R2: R2Bucket; PROJECT_NAME: string; WORKER_URL: string; } ``` When the same module coordinates file metadata in D1, also declare `DB: D1Database` as a required field. ## Choose R2 or D1 - Use R2 for file bodies, images, attachments, media, exports, and other objects addressed by key. - Use D1 for searchable business metadata, ownership, relations, status, and audit fields. - For managed files, store the body in R2 and store only its key and business metadata in D1. - Never use Worker local filesystem state for persistence a...

Details

Author
glitternetwork
Repository
glitternetwork/pinme
Created
1 years ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category