pinme-r2
pinme-r2 handles secure file uploads and downloads to your project's R2 bucket with automatic authentication and authorization. It provides streaming handlers for uploads, downloads with Range support, and metadata operations—all while keeping object keys server-controlled and enforcing size and media-type policies.
pinme-r2 streams files securely to Cloudflare R2 storage with built-in authentication and authorization checks.
AI-generated summary based on this skill's SKILL.md
Install
glitternetwork/pinme/pinme-r2 · repository language: TypeScript
git clone https://github.com/glitternetwork/pinme
cp -r pinme/skills/pinme-r2 ~/.claude/skills/pinme-r2Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I upload files to R2 in Cloudflare Workers with pinme-r2?
pinme-r2 provides streaming upload handlers that integrate with your Cloudflare Workers environment. The skill manages authentication automatically through your env.R2 binding, enforcing size limits and media-type policies while keeping object keys server-controlled. You stream file data directly to R2 without managing credentials yourself.
What authentication and authorization does pinme-r2 handle?
pinme-r2 handles secure key generation and ownership validation for files, ensuring only authorized users can access stored objects. It coordinates authentication through your R2 binding and enforces authorization policies server-side, so clients never need direct R2 credentials.
How do I download files from R2 with Range requests?
pinme-r2 supports Range requests and conditional headers for partial downloads, letting clients fetch specific byte ranges efficiently. This enables resume capability and bandwidth optimization when downloading files from your R2 bucket through Cloudflare Workers.
Can pinme-r2 manage R2 object metadata, deletion, and listing?
Yes. pinme-r2 handles R2 object lifecycle operations including metadata lookup, deletion, and listing with pagination support. You can retrieve object metadata with HEAD requests, delete individual or batch objects, and list contents of your R2 bucket programmatically.
How does pinme-r2 coordinate file storage between R2 and D1?
pinme-r2 coordinates file storage between R2 and D1 with state transitions, allowing you to track file metadata and ownership in your D1 database while storing actual content in R2. This enables consistent file management across both storage systems.
What are pinme-r2 file storage best practices for Workers?
pinme-r2 implements secure file storage by keeping object keys server-controlled, enforcing size and media-type policies, and using streaming handlers for efficient uploads and downloads. Always validate file ownership and authorization server-side, and use the env.R2 binding without exposing credentials to clients.
SKILL.md
rendered from the published skill — quoted content, verbatim
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
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
skills/pinme-r2/SKILL.md
skills/pinme-r2/agents/openai.yaml