Opa.Wasm 0.91.0

dotnet add package Opa.Wasm --version 0.91.0
                    
NuGet\Install-Package Opa.Wasm -Version 0.91.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Opa.Wasm" Version="0.91.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Opa.Wasm" Version="0.91.0" />
                    
Directory.Packages.props
<PackageReference Include="Opa.Wasm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Opa.Wasm --version 0.91.0
                    
#r "nuget: Opa.Wasm, 0.91.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Opa.Wasm@0.91.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Opa.Wasm&version=0.91.0
                    
Install as a Cake Addin
#tool nuget:?package=Opa.Wasm&version=0.91.0
                    
Install as a Cake Tool

About

Built and tested against Open Policy Agent v1.9.0

Features

  • Simple API on top of Open Policy Agent Web Assembly ABI
  • Support for advanced scenarios (runtime and module caching)
  • Fast execution path on ABI version 1.2 and greater
  • Ability to define builtin0-4
  • Extended error messages via opa_abort / Wasmtime.TrapException

Usage

The simplest use case - load a WASM module into a policy object, pass data and evaluate based on input:

using var module = OpaPolicyModule.Load("example.wasm");
using var opaPolicy = module.CreatePolicyInstance();

// Use the typed methods to interact with the policy instance
opaPolicy.SetData(new { world = "world" });
var output = opaPolicy.Evaluate<bool>(new { message = "world" });

// Alternatively, send raw Json for the utmost control (advanced scenario)
opaPolicy.SetDataJson(@"{""world"": ""world""}");
string output = opaPolicy.EvaluateJson(@"{""message"": ""world""}");

For higher-performance scenarios, you can keep the engine as well as the loaded WASM module around. Note that one engine can handle multiple modules, and the OpaPolicyModule keeps the correct reference to the engine to guarantee thread safety:

using var engine = OpaPolicyModule.CreateEngine();
using var opaPolicyModule = OpaPolicyModule.Load("example.wasm", engine);

// Now instantiate as many policy objects you want on top of the engine & module
using var opaPolicy = opaPolicyModule.CreatePolicyInstance();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Opa.Wasm:

Package Downloads
Excalibur.Application

A project within Excalibur to define the classes and methods related to the Application layer within a DDD solution.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.91.0 608 10/10/2025
0.90.0 13,520 12/24/2024
0.82.0 18,655 3/17/2024
0.81.0 1,553 1/3/2024
0.80.0 25,353 5/26/2023
0.70.0 36,673 1/29/2023
0.60.0 659 12/9/2022
0.50.0 669 11/10/2022
0.40.0 810 9/27/2022
0.33.0 731 8/30/2022
0.32.0 772 7/30/2022
0.31.0 2,747 4/5/2022
0.30.0 817 3/10/2022
0.23.0 17,044 2/7/2022
0.22.0 675 1/8/2022
0.21.0 657 1/5/2022
0.20.0 7,152 11/18/2021
0.19.0 709 11/7/2021
0.18.0 695 11/2/2021
0.17.0 699 10/6/2021
0.16.0 661 9/18/2021
0.15.0 692 9/1/2021
0.14.0 46,698 6/16/2021
0.13.0 774 5/22/2021
0.12.0 705 4/27/2021
0.11.0 708 3/20/2021
0.9.0 1,554 1/24/2021
0.8.0 783 1/21/2021
0.7.0 718 1/15/2021
0.6.0 1,580 11/7/2020
0.5.0 848 8/3/2020
0.4.0 850 7/2/2020
0.3.0 851 7/2/2020
0.2.1 863 3/9/2020
0.2.0 868 3/9/2020
0.1.0 1,162 11/19/2019