Skip to content

Publish to Hub — Functions

The Aerostack Hub is the community marketplace for Functions. Publish your Function and other developers can install it with one command. There’s no buying or selling — the Hub is free.


  • Share your work — other developers can install your Function into their projects as source code
  • Build reputation — earn Community Reputation points that increase your visibility in search
  • Get installs — your Function appears in the Hub search and CLI discovery
  • Help the ecosystem — every Function makes Aerostack more powerful for everyone

Any Function that solves a reusable problem:

CategoryExamples
authOAuth handlers, JWT utilities, rate limiters
paymentsStripe checkout, invoice generators, subscription managers
aiText summarizers, sentiment analyzers, embedding generators
mediaImage resizers, PDF generators, video processors
emailTemplate renderers, SMTP senders, newsletter managers
databaseMigration helpers, seed scripts, query builders
utilitySlug generators, ID generators, validators
analyticsEvent trackers, dashboard aggregators, report generators
notificationsPush notifications, Slack/Discord alerts, SMS senders
storageFile upload handlers, CDN managers, backup utilities

Every publishable Function needs an aerostack.json config and at least one source file.

  • Directorymy-function/
    • aerostack.json // Required — metadata and config
    • index.ts // Required — your function logic
    • README.md // Recommended — shown on the Hub page

This defines your Function’s identity, version, and how it should be installed.

aerostack.json
{
"name": "smart-rate-limiter",
"version": "1.0.0",
"description": "AI-powered rate limiter that adapts limits based on request patterns.",
"category": "auth",
"language": "typescript",
"runtime": "cloudflare-worker",
"license": "MIT",
"tags": ["rate-limit", "security", "ai", "adaptive"],
"entrypoint": "index.ts",
"routePath": "/api/rate-limit",
"routeExport": "rateLimiterRoute",
"npmDependencies": [],
"envVars": ["RATE_LIMIT_MAX", "RATE_LIMIT_WINDOW"],
"drizzleSchema": false
}
FieldRequiredDescription
nameYesFunction name — becomes the slug in the Hub URL
versionYesSemVer, e.g. 1.0.0. Bump on each publish
descriptionYesShort description shown in search results
categoryYesOne of: auth, payments, media, email, ai, database, utility, analytics, notifications, storage
languageYestypescript or javascript
runtimeYescloudflare-worker
licenseYesSPDX identifier: MIT, Apache-2.0, etc.
tagsNoSearch keywords, max 10
entrypointYesPath to main source file
routePathNoDefault HTTP route when installed (e.g. /api/rate-limit)
routeExportNoNamed Hono export from your file
npmDependenciesNonpm packages the consumer must install
envVarsNoEnvironment variables the consumer must set
drizzleSchemaNotrue if you export a Drizzle schema

Export a Hono route handler. This is the convention the CLI uses when installing.

index.ts
import { Hono } from 'hono'
// Named export — matches "routeExport" in aerostack.json
export const rateLimiterRoute = new Hono<{ Bindings: { CACHE: Cache } }>()
rateLimiterRoute.post('/check', async (c) => {
const { ip, endpoint } = await c.req.json<{ ip: string; endpoint: string }>()
const key = `ratelimit:${ip}:${endpoint}`
const current = parseInt(await c.env.CACHE.get(key) || '0')
const limit = parseInt(c.env.RATE_LIMIT_MAX || '100')
if (current >= limit) {
return c.json({ allowed: false, remaining: 0, resetIn: 60 }, 429)
}
await c.env.CACHE.put(key, String(current + 1), { expirationTtl: 60 })
return c.json({ allowed: true, remaining: limit - current - 1 })
})
rateLimiterRoute.get('/health', (c) =>
c.json({ module: 'smart-rate-limiter', ok: true })
)

The CLI is the fastest way to publish.

  1. Push to create a draft

    Terminal window
    aerostack functions push ./my-function/index.ts

    Output:

    Pushing function 'smart-rate-limiter' to Aerostack...
    Pushed successfully!
    Slug: smart-rate-limiter
    Status: draft
    Admin URL: https://app.aerostack.dev/functions/edit/<id>
  2. Review in Admin (optional)

    Open the Admin URL to add a README, adjust tags, and preview how it looks on the Hub.

  3. Publish

    Terminal window
    aerostack functions publish <id>

    Your Function is now live on the Hub.


Once published, any developer can install your Function:

Terminal window
# Install by slug
aerostack functions install smart-rate-limiter
# Install by username/slug
aerostack functions install alice/smart-rate-limiter

What happens when someone installs:

  1. The CLI downloads your source code
  2. Creates src/modules/smart-rate-limiter/ in their project
  3. Auto-registers the route in their aerostack.toml
  4. Auto-imports the route in their src/index.ts
  5. Prompts to install npm dependencies (if any)
  6. Prompts to set environment variables (if any)

The consumer owns the code. It’s copied as source — not linked as a dependency.


Every time you publish, a version snapshot is created. Past versions are preserved — consumers who installed an earlier version keep their code.

  • Bump version in aerostack.json before each publish
  • You cannot overwrite a published version
  • Use SemVer: 1.0.01.0.1 (patch), 1.1.0 (minor), 2.0.0 (breaking)

Publishing and getting installs earns Community Reputation:

ActionPoints
Publish a Function+10
Someone installs your Function+5
Someone stars your Function+2
Someone clones/forks your Function+5

Higher reputation = better visibility in Hub search results and the developer leaderboard.


ErrorFix
INVALID_CATEGORYCheck spelling, use lowercase
MISSING_ENTRYPOINTVerify entrypoint path in aerostack.json
EMPTY_CODEEntrypoint file is empty
DUPLICATE_SLUGName already taken by another account — rename your Function
UNAUTHORIZEDAPI key invalid — run aerostack login again
VERSION_CONFLICTBump version in aerostack.json