Extensions
Extensions are additional WASM modules that you can load into the gateway. To load an extension from the Grafbase extension repository, add it to the configuration with its name as the key, and the version requirement as the value. The version requirement follows the Cargo specification.
[extensions]
rest = "0.1"
You can also use the extended extension definition:
[extensions.rest]
version = "0.1"
path = "/path/to/build"
networking = false
stdout = false
stderr = false
environment_variables = false
max_pool_size = 1000
version
defines a version requirementpath
runs the extension from a predefined path in the filesystem. The path must contain validextension.wasm
andmanifest.json
files.networking
enables network access with TCP and UDP sockets, name resolution and WASI HTTP bindings to the guest.stdout
enables the guest to write to the standard output stream. Default value isfalse
.stderr
enables the guest to write to the standard error stream. Default value isfalse
.environment_variables
copies host environment variables to the guest. Default value isfalse
.max_pool_size
specifies the number of extension instances that can run concurrently. Default value is four times the number of CPU cores.