Iskra.StdWeb 0.3.0

dotnet add package Iskra.StdWeb --version 0.3.0
                    
NuGet\Install-Package Iskra.StdWeb -Version 0.3.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="Iskra.StdWeb" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Iskra.StdWeb" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Iskra.StdWeb" />
                    
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 Iskra.StdWeb --version 0.3.0
                    
#r "nuget: Iskra.StdWeb, 0.3.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 Iskra.StdWeb@0.3.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=Iskra.StdWeb&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Iskra.StdWeb&version=0.3.0
                    
Install as a Cake Tool

Iskra.StdWeb

Iskra.StdWeb provides strongly typed C# wrappers for standard browser APIs. The bindings are generated from WebIDL definitions and are intended for .NET WebAssembly applications that need direct access to the browser platform without a Blazor dependency.

What It Provides

  • Generated wrappers for DOM, Fetch, Canvas, WebGL, Web Audio, WebRTC, and other standard Web APIs.
  • Typed C# access to browser globals, interfaces, dictionaries, enums, callbacks, and events.
  • Integration with Iskra.JSCore for proxy creation, type marshalling, JavaScript object lifetime, and callback interop.
  • Generated code based on W3C WebIDL data from webref.

Quick Start

Create a browser WebAssembly project and add the package:

dotnet new wasmbrowser
dotnet add package Iskra.StdWeb

Initialize the StdWeb proxy factory before using generated browser types:

using System.Runtime.InteropServices.JavaScript;
using Iskra.JSCore;
using Iskra.StdWeb;

public static class Program
{
    public static async Task Main()
    {
        await StdWebProxyFactory.InitializeAsync();

        var window = JSObjectProxyFactory.GetProxy<Window>(JSHost.GlobalThis);
        var document = window.Document;

        var message = document.CreateElement("div");
        message.TextContent = "Hello from C#!";
        document.Body?.AppendChild(message);

        var button = document.CreateElement("button");
        button.TextContent = "Click me";
        document.Body?.AppendChild(button);

        button.AddEventListener("click", new EventListener(ev =>
        {
            window.Console.Log("Button clicked", ev.JSObject);
        }), false);

        await Task.Delay(Timeout.Infinite);
    }
}

Common Patterns

Access browser globals through JSObjectProxyFactory:

var window = JSObjectProxyFactory.GetProxy<Window>(JSHost.GlobalThis);
var document = window.Document;

Cast created elements to their more specific generated type when you need type-specific members:

var input = (HTMLInputElement)document.CreateElement("input");
input.Value = "Initial value";

Keep callback objects alive for as long as JavaScript may invoke them. For one-off application-level handlers, assigning the callback to a field is usually the simplest approach.

Generation

The generated sources live under AutoGen and are produced by ../Iskra.WebIDLGenerator. The generator consumes curated WebIDL definitions from the repository's ../../submodules/webref submodule.

Examples

Requirements

  • .NET 9.0 or later
  • Browser with WebAssembly support
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 is compatible.  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 Iskra.StdWeb:

Package Downloads
Iskra.Core

Core framework for building reactive WebAssembly UIs with C# and .NET — component model, rendering, signals, and source generators.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 42 6/2/2026
0.2.0 38 6/2/2026
0.1.0 248 11/9/2025