Configuration
Generally speaking, all configuration is defined at the Host level. As a plug-in, you are able to configuration data that has been provided by a Hosy, but you cannot edit runtime configuration. The sections below go into further detail about configurability, as well as some advanced functionality which require Extism to be built from source with specific feature flags.
Plug-ins
The most typical configuration you may elect to set as a Host is whether or not a plug-in is given access to WASI
functions - things like making a network request or accessing files on disk. Currently, as a plug-in focused runtime, Extism does not provide disk access to plug-ins at all, regardless of WASI enablement. We are open to feedback here, so please let us know what you think. Please be prepared to provide some additional context around how you would expect to grant granular path/file-based access control as well.
Outside of WASI
enablement, most plug-in configuration is done using The Manifest. However, there is another more generic option you can use as well when you don't want to use a manifest: the configuration object.
In each Host SDK, functionality is provided to allow a Host to pass arbitrary configuration data to plug-ins. This funciton is called something like SetConfig
, or this configuration object can be included in the SDKs' Manifest
equivalent.
To use this configuration data from within a plug-in, each PDK provides functions to access values of the configuration provided.
Hosts / Runtime
There are additional configuration options at the Host / runtime level, which you may need to enable by building Extism from source and adding the appropriate feature flags.
Feature Flags
The following optional (non-default) flags are available:
nn
: Provides the ability to perform ML inference from within a plug-in. This feature will link additionalWASI
API functions, adding to the size of the embedded runtime, and therefore not enabled by default. See WebAssembly/wasi-nn proposal for more information about using this.
If you would like to enable any of the features above, please follow the instructions below:
git clone git@github.com:extism/extism.git
cd extism
cargo build --release --features http,register-http,register-filesystem,nn
# once complete, a libextism.so or libextism.dylib should be in the target/release/ directory.
By default, the following flags are included in our official releases. You can disable them by following the same instructions above, and removing the features you do not want included.
register-http
: Enables .wasm plug-ins to be downloaded using HTTP (expects network availability).register-filesystem
: Enables .wasm plug-ins to be loaded from disk.http
: Enablesextism_http_request
(a non-WASI
HTTP interface enabling plug-ins to make outbound requests).