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 requirement
  • path runs the extension from a predefined path in the filesystem. The path must contain valid extension.wasm and manifest.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 is false.
  • stderr enables the guest to write to the standard error stream. Default value is false.
  • environment_variables copies host environment variables to the guest. Default value is false.
  • max_pool_size specifies the number of extension instances that can run concurrently. Default value is four times the number of CPU cores.