cloudflare-workers-runtime-apis

Solid

Cloudflare Workers Runtime APIs including Fetch, Streams, Crypto, Cache, WebSockets, and Encoding. Use for HTTP requests, streaming, encryption, caching, real-time connections, or encountering API compatibility, response handling, stream processing errors.

DevOps & Infrastructure 168 stars 27 forks Updated 4 weeks ago MIT

Install

View on GitHub

Quality Score: 89/100

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

Skill Content

# Cloudflare Workers Runtime APIs Master the Workers runtime APIs: Fetch, Streams, Crypto, Cache, WebSockets, and text encoding. ## Quick Reference | API | Purpose | Common Use | |-----|---------|------------| | **Fetch** | HTTP requests | External APIs, proxying | | **Streams** | Data streaming | Large files, real-time | | **Crypto** | Cryptography | Hashing, signing, encryption | | **Cache** | Response caching | Performance optimization | | **WebSockets** | Real-time connections | Chat, live updates | | **Encoding** | Text encoding | UTF-8, Base64 | ## Quick Start: Fetch API ```typescript export default { async fetch(request: Request, env: Env): Promise<Response> { // Basic fetch const response = await fetch('https://api.example.com/data'); // With options const postResponse = await fetch('https://api.example.com/users', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${env.API_KEY}`, }, body: JSON.stringify({ name: 'John' }), }); // Clone for multiple reads const clone = response.clone(); const json = await response.json(); const text = await clone.text(); return Response.json(json); } }; ``` ## Critical Rules 1. **Always set timeouts for external requests** - Workers have a 30s limit, external APIs can hang 2. **Clone responses before reading body** - Body can only be read once 3. **Use streaming for large payloads** - Don't buffer entire...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
7 months ago
Last Updated
4 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category