No description
Find a file
2025-07-17 14:10:39 -07:00
src feat: multipart, 206, FetchHttpHandler etc. 2025-07-18 02:27:19 +05:30
.env.example Fully switch to bun / remove slack / update package list 2025-03-11 09:59:01 -04:00
.gitignore Fully switch to bun / remove slack / update package list 2025-03-11 09:59:01 -04:00
bun.lockb feat: multipart, 206, FetchHttpHandler etc. 2025-07-18 02:27:19 +05:30
Dockerfile Try curl + wget 2025-02-24 21:16:00 -05:00
index.js Fully switch to bun / remove slack / update package list 2025-03-11 09:59:01 -04:00
package.json feat: multipart, 206, FetchHttpHandler etc. 2025-07-18 02:27:19 +05:30
README.md Simplify readme & put usage example up top 2025-03-11 09:27:51 -04:00

flag

cdn.hackclub.com

Deep under the waves and storms there lies a vault...

Banner

Banner illustration by @maxwofford.

Slack Channel

📡 API Usage

  • All API endpoints require authentication via Authorization: Bearer api-token header
  • Use the API_TOKEN from your environment configuration
  • Failure to include a valid token will result in 401 Unauthorized responses

V3 API (Latest)

Version 3

Endpoint: POST https://cdn.hackclub.com/api/v3/new

Headers:

Authorization: Bearer api-token
Content-Type: application/json

Request Example:

curl --location 'https://cdn.hackclub.com/api/v3/new' \
--header 'Authorization: Bearer beans' \
--header 'Content-Type: application/json' \
--data '[
  "https://assets.hackclub.com/flag-standalone.svg",
  "https://assets.hackclub.com/flag-orpheus-left.png"
]'

Response:

{
  "files": [
    {
      "deployedUrl": "https://hc-cdn.hel1.your-objectstorage.com/s/v3/64a9472006c4472d7ac75f2d4d9455025d9838d6_flag-standalone.svg",
      "file": "0_64a9472006c4472d7ac75f2d4d9455025d9838d6_flag-standalone.svg",
      "sha": "64a9472006c4472d7ac75f2d4d9455025d9838d6",
      "size": 4365
    },
    {
      "deployedUrl": "https://hc-cdn.hel1.your-objectstorage.com/s/v3/d926bfd9811ebfe9172187793a171a5cbcc61992_flag-orpheus-left.png",
      "file": "1_d926bfd9811ebfe9172187793a171a5cbcc61992_flag-orpheus-left.png",
      "sha": "d926bfd9811ebfe9172187793a171a5cbcc61992",
      "size": 8126
    }
  ],
  "cdnBase": "https://hc-cdn.hel1.your-objectstorage.com"
}
V2 API Version 2

Endpoint: POST https://cdn.hackclub.com/api/v2/new

Headers:

Authorization: Bearer api-token
Content-Type: application/json

Request Example:

[
  "https://assets.hackclub.com/flag-standalone.svg",
  "https://assets.hackclub.com/flag-orpheus-left.png"
]

Response:

{
  "flag-standalone.svg": "https://cdn.example.dev/s/v2/flag-standalone.svg",
  "flag-orpheus-left.png": "https://cdn.example.dev/s/v2/flag-orpheus-left.png"
}
V1 API Version 1

Endpoint: POST https://cdn.hackclub.com/api/v1/new

Headers:

Authorization: Bearer api-token
Content-Type: application/json

Request Example:

[
  "https://assets.hackclub.com/flag-standalone.svg",
  "https://assets.hackclub.com/flag-orpheus-left.png"
]

Response:

[
  "https://cdn.example.dev/s/v1/0_flag-standalone.svg",
  "https://cdn.example.dev/s/v1/1_flag-orpheus-left.png"
]

Technical Details

  • Storage Structure: /s/v3/{HASH}_{filename}
  • File Naming: /s/{slackUserId}/{unix}_{sanitizedFilename}

Made with 💜 for Hack Club