Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
tencentedgeone avatar

Makers Edge Functions

  • 30 installs
  • 2k repo stars
  • Updated July 16, 2026
  • tencentedgeone/edgeone-makers-tools

Use when working on frontend tasks.

About

Makers Edge Functions is a skill that helps with frontend work. It supports teams during the build phase of development. Use this skill to improve your frontend processes and deliverables.

  • Edge
  • Functions
  • Makers

Makers Edge Functions by the numbers

  • 30 all-time installs (skills.sh)
  • Ranked #416 of 782 Skill Development skills by installs in the Skillselion catalog
  • Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/tencentedgeone/edgeone-makers-tools --skill makers-edge-functions

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs30
repo stars2k
Last updatedJuly 16, 2026
Repositorytencentedgeone/edgeone-makers-tools

What it does

Use when working on frontend tasks.

Files

SKILL.mdMarkdownGitHub ↗

Edge Functions

V8-based lightweight functions running at the edge. Ideal for simple APIs, KV storage access, and ultra-low latency responses.

Runtime: V8 (like Cloudflare Workers) — NOT Node.js. Do NOT use Node.js built-ins or npm packages.

>

⚠️ Response.json() is NOT available in this V8 runtime. Always use new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } }) instead.

Basic function

File: edge-functions/api/hello.js

export default function onRequest(context) {
  return new Response('Hello from Edge Functions!');
}

Access: GET /api/hello

HTTP method handlers

// edge-functions/api/users.js

// Handle all methods
export function onRequest(context) {
  return new Response('Any method');
}

// Or use specific method handlers:
export function onRequestGet(context) {
  return new Response(JSON.stringify({ users: [] }), {
    headers: { 'Content-Type': 'application/json' },
  });
}

export async function onRequestPost(context) {
  const body = await context.request.json();
  return new Response(JSON.stringify({ created: true }), {
    status: 201,
    headers: { 'Content-Type': 'application/json' },
  });
}

EventContext object

export function onRequest(context) {
  const {
    request,    // Standard Request object
    params,     // Dynamic route params, e.g. { id: "123" }
    env,        // Environment variables from Pages console
    waitUntil,  // Extend function lifetime for async tasks
  } = context;

  // GEO info available via:
  const geo = context.request.eo;
  // geo.geo.countryName, geo.geo.cityName, geo.geo.latitude, etc.

  return new Response('OK');
}

Dynamic routes

// edge-functions/api/users/[id].js
// Matches: /api/users/123, /api/users/abc

export function onRequestGet(context) {
  const userId = context.params.id;
  return new Response(JSON.stringify({ userId }), {
    headers: { 'Content-Type': 'application/json' },
  });
}
// edge-functions/api/[[default]].js
// Catches all unmatched routes under /api/

export function onRequest(context) {
  return new Response('Catch-all route', { status: 404 });
}

KV Storage (Edge Functions only)

⚠️ Prerequisites: You must enable KV Storage in the EdgeOne Pages console, create a namespace, and bind it to your project before using KV. See kv-storage.md for full setup instructions (same directory).

The KV namespace is a global variable (name is set when binding in the console) — it is NOT on context.env.

// edge-functions/api/counter.js

export async function onRequest(context) {
  // ⚠️ my_kv is a GLOBAL variable (name set when binding namespace in console)
  // Do NOT use context.env.KV ❌
  
  // Read
  const count = await my_kv.get('page_views') || '0';
  const newCount = parseInt(count) + 1;

  // Write
  await my_kv.put('page_views', String(newCount));

  return new Response(JSON.stringify({ views: newCount }), {
    headers: { 'Content-Type': 'application/json' },
  });
}

For full KV Storage API reference and usage guide, see: kv-storage.md (same directory).

Supported Runtime APIs

Edge Functions run on V8 and support these Web Standard APIs:

  • Fetch APIfetch() for outbound HTTP requests
  • Cache APIcaches.open(), cache.match(), cache.put()
  • Headers / Request / Response — standard Web API objects
  • StreamsReadableStream, WritableStream, TransformStream
  • Web Cryptocrypto.subtle for encryption/signing
  • EncodingTextEncoder, TextDecoder
  • URL / URLSearchParams — URL parsing

⚠️ NOT available: Node.js built-ins (fs, path, http, crypto from Node), require(), npm packages.

Limits

ResourceLimit
Code package size5 MB
Request body1 MB
CPU time per invocation200 ms
LanguageJavaScript (ES2023+) only

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.