PackCDN Documentation

Instant package publishing and distribution platform with global CDN, built on Cloudflare Workers and Vercel Serverless Functions.

📦 Overview

PackCDN is a zero-configuration platform for instantly publishing and sharing code packages. No registration required. Anonymous and free forever.

4
API Endpoints
3
Package Types
Global CDN
0
Registration

Features

🚀

Instant Publishing

Upload code, get CDN URLs in seconds

🌍

Global CDN

Cloudflare Workers edge network

🔒

Anonymous

No accounts, no tracking

WASM Support

Upload and serve WebAssembly

🔍

Smart Analysis

Automatic dependency detection

🔄

Multi-format

JavaScript, Python, WASM

🔌 API Reference

GET /api/get-pack

Retrieve package by ID or URL ID

GET https://pack-cdn.vercel.app/api/get-pack?id={id}

POST /api/publish

Publish new package with CDN

POST /api/publish
{ "name": "my-package", "files": {...} }

POST /api/analyze

Analyze code for dependencies

POST /api/analyze
{ "code": "import React", "type": "npm" }

GET /api/search

Search public packages

GET /api/search?q=react&type=npm
$ curl -X POST https://pack-cdn.vercel.app/api/publish \
-H "Content-Type: application/json" \
-d '{"name":"my-package","files":{"index.js":"..."}}'

{
"success": true,
"cdnUrl": "https://packcdn.../cdn/abc123",
"installCommand": "pack install my-package https://..."
}

🏗️ Architecture

// Package Storage Format in Supabase
{
"url_id": "abc123xyz",
"name": "my-package",
"files": {
"index.js": "export default function() {...}",
"module.wasm": "AGFzbQEAAAAG..."
},
"pack_json": "{\"type\":\"module\",\"version\":\"1.0.0\"}"
}

🚀 Getting Started

1. Create Package

Use our built-in editor or upload existing files

2. Configure

Set package name, type, and visibility

3. Publish

Get instant CDN URLs and installation commands

4. Use Anywhere

Import directly in browser, Node.js, or other projects

// Using a published package
import myPackage from 'https://packcdn.../cdn/abc123';

// or in HTML
<script src="https://packcdn.../cdn/abc123/index.js"></script>

// or with curl
curl https://packcdn.../cdn/abc123/index.js