Skip to main content

Using the Elixir / Erlang Host SDK

1. Install the package

Install via

For Mix:

{:extism, "~> 0.5.0"}
Rust Dependency

The extism package is written in rust and the NIF must be compiled in your application with mix. Because of that, installing rust is currently a requirement. We recommend installing rustup.

2. Import the library and use the APIs

Count Vowels Plugin

code.wasm in this example is our example plugin that counts vowels. If you want to run this, download it first and set the path:

curl > code.wasm
require Extism

# point to the count-vowels plugin on my machine
manifest = %{ wasm: [ %{ path: "code.wasm" } ]}
# NOTE: if you encounter an error such as:
# "Unable to load plugin: unknown import: wasi_snapshot_preview1::fd_write has not been defined"
# change `false` to `true` in the following function to provide WASI imports to your plugin.
{:ok, plugin} =, false)
{:ok, output} =, "count_vowels", "this is a test")
# => %{"count" => 4}

Need help?

If you've encountered a bug or think something is missing, please open an issue on the Extism GitHub repository.

There is an active community on Discord where the project maintainers and users can help you. Come hang out!