Optional
allowDetermines whether or not HTTP response headers should be exposed to plugins,
when set to true
, extism:host/env::http_headers
will return the response
headers for HTTP requests made using extism:host/env::http_request
Optional
allowedA list of allowed hostnames. Wildcard subdomains are supported via *
.
Requires the plugin to run in a worker using runInWorker: true
.
await createPlugin('path/to/some/wasm', {
runInWorker: true,
allowedHosts: ['*.example.com', 'www.dylibso.com']
})
Optional
allowedOptional
configOptional
enableWhether WASI stdout should be forwarded to the host.
Overrides the EXTISM_ENABLE_WASI_OUTPUT
environment variable.
Optional
fetchOptional
init: RequestInitOptional
init: RequestInitOptional
functionsA map of namespaces to function names to host functions.
const functions = {
'my_great_namespace': {
'my_func': (callContext: CallContext, input: bigint) => {
const output = callContext.read(input);
if (output !== null) {
console.log(output.string());
}
}
}
}
Rest
...args: any[]Optional
logThe log level to use.
Optional
loggerA logger implementation. Must provide trace
, info
, debug
, warn
, and error
methods.
Optional
memoryOptional
Experimental
runWhether or not to run the Wasm module in a Worker thread. Requires
CAPABILITIES.hasWorkerCapability
to
be true. Defaults to false.
This feature is marked experimental as we work out a bug.
Optional
sharedOptional
timeoutOptional
useWhether or not to enable WASI preview 1.
Generated using TypeDoc
Options for initializing an Extism plugin.