Skip to content
How-to guides Cloud browsers with Klyroo.Hotkey

Cloud browsers with Klyroo.Hotkey

Add Klyroo.Hotkey to your .NET backend to manage Hotkey cloud browsers, request human input and receive signed events. A Klyroo web or MAUI client can display the resulting status or authorized handoff link through your backend.

On this page

Add it to a Klyroo application

The library is an optional server-side add-on. Register it in the server's Program.cs alongside AddKlyrooStack(). Keep the API key in server configuration outside the project's source and select the browser from an authenticated user's server-side mapping.

Build the package from the sibling klyroo-hotkey repository and use the output as a local NuGet feed:

Shell
dotnet pack ../klyroo-hotkey/src/Klyroo.Hotkey -c Release -o ./artifacts/hotkey
dotnet add /path/to/Server.csproj package Klyroo.Hotkey --version 0.1.0-preview.1 --no-restore
dotnet restore /path/to/Server.csproj --source "$PWD/artifacts/hotkey" --source https://api.nuget.org/v3/index.json
C#
using Klyroo.Hotkey;
using Klyroo.Stack;

builder.Services.AddKlyrooStack();
builder.Services.AddKlyrooHotkey(
    services => services.GetRequiredService<IConfiguration>()["Hotkey:ApiKey"]
        ?? throw new InvalidOperationException("Missing server setting Hotkey:ApiKey."));

Use it in an authenticated workflow

  1. Provision a browser. Pass your stable user ID as BrowserCreate.ExternalId. GetOrCreateBrowserAsync recovers the existing browser when Hotkey reports a provisioning conflict.
  2. Ask a person to take over. Call CreateAskAsync for the user's browser and give their authorized session the expiring handoff link. Let Hotkey host the sign-in or confirmation step.
  3. Resume after the outcome. Verify the webhook against the raw body with HotkeyWebhook.VerifyAndRead, then deduplicate by event ID before updating your workflow. Use GetAskAsync when you need to read the current state on demand.

The SDK also supports browser lifecycle, locale settings, live-view embeds, downloads, usage, scoped keys and webhook endpoint management. Hotkey hosts the browsers and controls their site permissions. Try the interactive Klyroo.Hotkey playground in your browser, read the Klyroo.Hotkey documentation (getting started, guides, concepts, platforms, API reference and FAQ), or consult the Hotkey HTTP API, live-view setup and signed webhook contract.