Skip to content
Back to skills

076 Api 09b87d58

ASecurity

```javascript export default { async fetch(request, env, ctx) { // request: Request, env: {} (empty in playground), ctx: ExecutionContext return new Response('Hello') }, } ```

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentjavascriptjavaapi

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 076-api_09b87d58 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 076 Api 09b87d58?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 076 Api 09b87d58
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-076-api-09b87d58/badge)](https://www.skillsdirectory.com/skills/tools-only-076-api-09b87d58)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Workers Playground API

## Handler

```javascript
export default {
  async fetch(request, env, ctx) {
    // request: Request, env: {} (empty in playground), ctx: ExecutionContext
    return new Response('Hello')
  },
}
```

## Request

```javascript
const method = request.method // "GET", "POST"
const url = new URL(request.url) // Parse URL
const headers = request.headers // Headers object
const body = await request.json() // Read body (consumes stream)
const clone = request.clone() // Clone before reading body

// Query params
url.searchParams.get('page') // Single value
url.searchParams.getAll('tag') // Array

// Cloudflare metadata
request.cf.country // "US"
request.cf.colo // "SFO"
```

## Response

```javascript
// Text
return new Response('Hello', { status: 200 });

// JSON
return Response.json({ data }, { status: 200, headers: {...} });

// Redirect
return Response.redirect('/new-path', 301);

// Modify existing
const modified = new Response(response.body, response);
modified.headers.set('X-Custom', 'value');
```

## ExecutionContext

```javascript
// Background work (after response sent)
ctx.waitUntil(fetch('https://logs.example.com', { method: 'POST', body: '...' }))
return new Response('OK') // Returns immediately
```

## Fetch

```javascript
const response = await fetch('https://api.example.com')
const data = await response.json()

// With options
await fetch(url, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Alice' }),
})
```

## Cache

```javascript
const cache = caches.default

// Check cache
let response = await cache.match(request)
if (!response) {
  response = await fetch(origin)
  await cache.put(request, response.clone()) // Clone before put!
}
return response
```

## Crypto

```javascript
crypto.randomUUID() // UUID v4
crypto.getRandomValues(new Uint8Array(16))

// SHA-256 hash
const hash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(data))
```

## Limits (Playground = Free Plan)

| Resource    | Limit  |
| ----------- | ------ |
| CPU time    | 10ms   |
| Subrequests | 50     |
| Memory      | 128 MB |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.