{"id":18462691,"url":"https://github.com/extism/elixir-sdk","last_synced_at":"2026-03-02T03:04:20.032Z","repository":{"id":194619025,"uuid":"691134020","full_name":"extism/elixir-sdk","owner":"extism","description":"Extism Elixir Host SDK - easily run WebAssembly modules / plugins from Elixir applications","archived":false,"fork":false,"pushed_at":"2024-10-22T19:31:24.000Z","size":2182,"stargazers_count":34,"open_issues_count":6,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-08T07:38:21.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://extism.org","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/extism.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-13T15:07:19.000Z","updated_at":"2025-04-02T09:06:12.000Z","dependencies_parsed_at":"2025-04-08T07:35:36.409Z","dependency_job_id":"fa60ff93-4b8e-4035-bd38-bd40af315c9d","html_url":"https://github.com/extism/elixir-sdk","commit_stats":null,"previous_names":["extism/elixir-sdk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/extism/elixir-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extism%2Felixir-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extism%2Felixir-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extism%2Felixir-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extism%2Felixir-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extism","download_url":"https://codeload.github.com/extism/elixir-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extism%2Felixir-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T09:04:05.117Z","updated_at":"2026-03-02T03:04:20.009Z","avatar_url":"https://github.com/extism.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extism\n\nExtism Host SDK for Elixir\n\n## Docs\n\nRead the [docs on hexdocs.pm](https://hexdocs.pm/extism/).\n\n## Installation\n\nYou can find this package on hex.pm [![hex.pm](https://img.shields.io/hexpm/v/extism.svg)](https://hex.pm/packages/extism)\n\n```elixir\ndef deps do\n  [\n    {:extism, \"1.0.0\"}\n  ]\nend\n```\n\n\u003e **Note**: You do not need to install the Extism Runtime shared object, but you will need a rust toolchain installed to build this package. See [Install Rust](https://www.rust-lang.org/tools/install) to install for your platform.\n\n## Getting Started\n\nThis guide should walk you through some of the concepts in Extism and this Elixir library.\n\n\u003e *Note*: You should be able to follow this guide by copy pasting the code into `iex` using `iex -S mix`.\n\n### Creating A Plug-in\n\nThe primary concept in Extism is the [plug-in](https://extism.org/docs/concepts/plug-in). You can think of a plug-in as a code module stored in a `.wasm` file.\n\nSince you may not have an Extism plug-in on hand to test, let's load a demo plug-in from the web:\n\n```elixir\nurl = \"https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm\"\nmanifest = %{wasm: [%{url: url}]}\n{:ok, plugin} = Extism.Plugin.new(manifest, false)\n```\n\n\u003e **Note**: See [the Manifest docs](https://extism.org/docs/concepts/manifest) as it has a rich schema and a lot of options.\n\n### Calling A Plug-in's Exports\n\nThis plug-in was written in Rust and it does one thing, it counts vowels in a string. As such, it exposes one \"export\" function: `count_vowels`. We can call exports using [Extism.Plugin#call/3](https://hexdocs.pm/extism/Extism.Plugin.html#call/3):\n\n```elixir\n{:ok, output} = Extism.Plugin.call(plugin, \"count_vowels\", \"Hello, World!\")\n# =\u003e {\"count\": 3, \"total\": 3, \"vowels\": \"aeiouAEIOU\"}\n```\n\nAll exports have a simple interface of bytes-in and bytes-out. This plug-in happens to take a string and return a JSON encoded string with a report of results.\n\n### Plug-in State\n\nPlug-ins may be stateful or stateless. Plug-ins can maintain state b/w calls by the use of variables. Our count vowels plug-in remembers the total number of vowels it's ever counted in the \"total\" key in the result. You can see this by making subsequent calls to the export:\n\n```elixir\n{:ok, output} = Extism.Plugin.call(plugin, \"count_vowels\", \"Hello, World!\")\n# =\u003e {\"count\": 3, \"total\": 6, \"vowels\": \"aeiouAEIOU\"}\n{:ok, output} = Extism.Plugin.call(plugin, \"count_vowels\", \"Hello, World!\")\n# =\u003e {\"count\": 3, \"total\": 9, \"vowels\": \"aeiouAEIOU\"}\n```\n\nThese variables will persist until this plug-in is freed or you initialize a new one.\n\n### Configuration\n\n\u003e TODO: Implement config\n\nPlug-ins may optionally take a configuration object. This is a static way to configure the plug-in. Our count-vowels plugin takes an optional configuration to change out which characters are considered vowels. Example:\n\n```elixir\n{:ok, output} = Extism.Plugin.call(plugin, \"count_vowels\", \"Yellow, World!\")\n# =\u003e {\"count\": 3, \"total\": 3, \"vowels\": \"aeiouAEIOU\"}\n\n{:ok, plugin} = Extism.Plugin.new(manifest, false, %{\"vowels\": \"aeiouyAEIOUY\"})\n{:ok, output} = Extism.Plugin.call(plugin, \"count_vowels\", \"Yellow, World!\")\nplugin.call(\"count_vowels\", \"Yellow, World!\")\n# =\u003e {\"count\": 4, \"total\": 4, \"vowels\": \"aeiouAEIOUY\"}\n```\n\n### Host Functions\n\nWe don't offer host function support in this library yet. If it is something you need, please [file an issue](https://github.com/extism/elixir-sdk/issues/new)!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextism%2Felixir-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextism%2Felixir-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextism%2Felixir-sdk/lists"}