Supported Runtimes

FnKit supports 9 HTTP runtimes via the Google Cloud Functions Framework and 3 MQTT runtimes via the FnKit Function Framework.

HTTP Runtimes

HTTP functions listen on port 8080 and handle standard HTTP requests. They’re compatible with the Google Cloud Functions Framework, so you can use the same function signature locally and in production.

Runtime Command Framework Quickstart
Node.js fnkit node <name> functions-framework-nodejs Guide
Python fnkit python <name> functions-framework-python Guide
Go fnkit go <name> functions-framework-go Guide
Java fnkit java <name> functions-framework-java Guide
Ruby fnkit ruby <name> functions-framework-ruby Guide
.NET fnkit dotnet <name> functions-framework-dotnet Guide
PHP fnkit php <name> functions-framework-php Guide
Dart fnkit dart <name> functions-framework-dart Guide
C++ fnkit cpp <name> functions-framework-cpp Guide

Creating an HTTP Function

# Shorthand (recommended)
fnkit node my-api

# Explicit form
fnkit new python my-api

# With a git remote
fnkit go my-api --remote git@github.com:user/my-api.git

What Gets Generated

Each runtime generates a project with:

  • Source file — A hello world function using the framework’s standard signature
  • Dockerfile — Multi-stage build optimised for the runtime
  • docker-compose.yml — Pre-configured for fnkit-network and gateway integration
  • .gitignore — Tailored to the runtime
  • Dependencies — Installed automatically (e.g., npm install, pip install)

Running Locally

cd my-api
fnkit dev                       # Uses the runtime's dev command
fnkit dev --port 3000           # Custom port
fnkit dev --target myFunction   # Specific function target

MQTT Runtimes

MQTT functions subscribe to topics on an MQTT broker instead of listening on HTTP. They’re event-driven — each message triggers your function handler.

Runtime Command Framework
Node.js fnkit node-mqtt <name> function-framework-nodejs
Go fnkit go-mqtt <name> function-framework-go
.NET fnkit dotnet-mqtt <name> function-framework-dotnet

Creating an MQTT Function

fnkit node-mqtt my-handler
fnkit go-mqtt my-handler
fnkit dotnet-mqtt my-handler

MQTT functions connect to a broker and subscribe to {prefix}/{target} (e.g., fnkit/my-handler). See the MQTT deep dive for configuration, environment variables, and broker setup.

Checking Runtime Dependencies

# Check all runtimes
fnkit doctor

# Check a specific runtime
fnkit doctor node
fnkit doctor python
fnkit doctor go

The doctor command checks that the runtime and any required build tools (e.g., Maven for Java, CMake for C++) are installed and available in your PATH.