Step-by-step guide

Add SkyyDesk to your application, step by step

In this guide we add SkyyDesk to an empty .NET application and then connect to it from another computer. Each step has the command to type and what you should see on screen. Every screenshot comes from the real run we did while writing this guide.

First, see how it works

  1. Your applicationContains the SkyyDesk library. Gets an ID for the machine and asks you about incoming requests.
  2. SkyyDesk serversBring the two sides together and carry the picture. Accounts, address books and licences live here.
  3. The person connectingConnects from skyydesk.com in a browser or from the SkyyDesk app, with their own account.
  1. Your application starts.The library connects to the server and gets a 9-digit ID for the machine. If you gave an enrollment key, the machine is also written into your address book.
  2. Someone wants to connect.They type the ID on skyydesk.com or click the machine in the panel's address book.
  3. Your application decides.The request reaches your application as an event. Nobody gets in until you accept.
  4. The screen streams.The person connecting sees this machine's screen; their mouse and keyboard work here.

There is no sign-in in the library. The person connecting signs in with their own SkyyDesk account and licence; your application only opens the door or keeps it shut.

Before you start

Step by step

  1. Create an enrollment key in the panel

    On skyydesk.com click Sign in and sign in with your account. Open Settings from the menu on the left and scroll down to the Enrollment keys card. Give the key a name you will recognise, for example "Store tills", and press Create key.

    Settings page in the panel, the Enrollment keys card at the bottom
    Panel, Settings, Enrollment keys at the bottom.

    The key is shown only once, right now. Press Copy and save it somewhere. If you lose it, create a new one.

    New key starting with sdk_ and the Copy button
    What you should see: a key starting with sdk_ and a row marked "Active" in the list.

    This step is optional. Without a key everything still works; the machine just does not appear in your address book by itself, and you connect by typing its ID.

  2. Download the NuGet package

    Download the .NET package from the developer page. It is not on nuget.org. Create a folder named paketler in your working folder and put the file in it:

    Folder
    calisma/
    ├── paketler/
    │   └── SkyyDesk.1.4.10.nupkg
    └── Uygulamam/        ← created in step 3
  3. Add the package to your application

    Open a terminal (PowerShell on Windows, or the Terminal window in Visual Studio), go to the working folder and type these three commands. If you already have a project, run only the last one, in your project's folder.

    Terminal
    dotnet new console -o Uygulamam
    cd Uygulamam
    dotnet add package SkyyDesk --source ../paketler
    Output of dotnet add package in the terminal
    What you should see: "PackageReference for package 'SkyyDesk' version '1.4.10' added" and "Restored" at the bottom. The X.509 lines on Linux are .NET's own notice.

    The package copies the library into the build output itself: skyydesk.dll and the DLLs next to it on Windows, libskyydesk.so on Linux. You do not copy anything by hand.

  4. Write Program.cs

    Delete what is in Program.cs and paste this. It is the same file as examples/dotnet/Program.cs in the package.

    Program.cs
    using SkyyDesk;
    
    var desk = new SkyyDeskHost(Path.Combine(AppContext.BaseDirectory, "skyydesk-data"));
    desk.Incoming += (_, c) =>
    {
        if (c.Authorized) return;
        Console.Write($"{c.Name} ({c.PeerId}) wants to connect. Allow? [y/N] ");
        if (Console.ReadKey().KeyChar is 'y' or 'Y') desk.Accept(c.Id); else desk.Close(c.Id);
        Console.WriteLine();
    };
    desk.Closed += (_, id) => Console.WriteLine($"connection {id} closed");
    desk.Enrolled += (_, r) => Console.WriteLine(r.Ok ? "added to the address book" : $"enroll failed: {r.Error}");
    
    if (args.Length > 0) desk.SetEnrollKey(args[0]);
    desk.Start(allowPassword: true);
    Console.WriteLine($"SkyyDesk ID {desk.MyId}, one-time password {desk.OneTimePassword}");
    Thread.Sleep(Timeout.Infinite);

    What each line does:

    new SkyyDeskHost(...)
    Starts the library. It must come first, before anything else: the library starts copies of your application for its own helper work, and those copies end on this line.
    Incoming
    Runs when someone wants to connect. If Authorized is false the person is waiting for approval: Accept(c.Id) lets them in, Close(c.Id) turns them away.
    Closed
    Runs when a connection ends.
    Enrolled
    Tells you the result of the enrollment key: the machine was added to the address book, or why it was not.
    SetEnrollKey
    Passes the key from step 1. The key is stored on the machine; you do not need to pass it again on later starts.
    Start
    Makes the machine reachable. With allowPassword: true anyone who knows the one-time password gets in without approval. If everyone should need approval, write false.
    MyId
    The machine's ID. Show this to the person who will connect.
  5. Run the application

    Run it with your key at the end of the command:

    Terminal
    dotnet run -- sdk_anahtariniz
    The application prints its ID and that it was added to the address book
    What you should see: a 9-digit ID on the "SkyyDesk ID" line and "added to the address book" below it.

    The machine can be reached for as long as the application stays open.

  6. Connect from another computer

    On the second computer open skyydesk.com. Type the ID into the Connect now box and press Connect. The session opens in a new tab and waits for approval.

    The Connect now box on the skyydesk.com home page with an ID typed in
    skyydesk.com home page, Connect now.
    Session page: waiting for the other side to approve
    What you should see: the ID and, below it, a message that it is waiting for the other side's approval.
  7. Approve in the application

    At the same moment the Incoming event runs in your application. The example asks in the terminal who wants to connect. Press y.

    In the terminal: wants to connect. Allow? [y/N]
    What you should see: "wants to connect. Allow? [y/N]". The account name of the person connecting is at the start of the line; we blurred it in the picture.
  8. The screen arrives

    A few seconds after approval the person connecting sees this machine's screen and uses it with mouse and keyboard. Below is the screen of the machine where the application runs: the "y" in the terminal came from this screen too.

    The remote machine's screen in a browser session
    What you should see: a toolbar at the top and the other machine's live screen below it.

    When the session is closed, the Closed event runs and the terminal prints "connection ... closed".

  9. Find the machine in your address book

    Open the Address book in the panel. The machine you gave the enrollment key to is listed under Ungrouped with its name and ID, marked Online while it is running. Next time you connect from here without typing the ID, and you can move the machine into a group.

    Address book in the panel, machine online
    What you should see: the machine's name, its ID and Online.

Moving it into your own application

In other languages

C, Java and Delphi call the same C functions. Open the Windows zip or the Linux tar.gz; the examples are in the examples folder.

Inside the Linux package: library, header, README and examples
Inside the Linux package. The Windows zip has skyydesk.dll and the DLLs next to it instead of libskyydesk.so.
LanguageHow to buildExample
CWindows: cl host.c skyydesk.lib
Linux: cc host.c -o host -L. -lskyydesk -Wl,-rpath,'$ORIGIN'
examples/c/host.c
JavaWith JNA 5.x; no JNI code to build. Put the library next to the application.examples/java/SkyyDeskHost.java
DelphiAdd the SkyyDesk.pas unit to the project.examples/delphi/Host.dpr

The C example behaves like the .NET one: it prints the ID and asks "allow connection N? [y/N]" when a request comes in.

Common problems

What you seeWhyWhat to do
On Windows the connection opens but no screen arrivesNo Windows session is signed in on the machine, or a Remote Desktop (RDP) window was closed and left the session disconnected. Windows gives no screen in that state.Keep a user session signed in on the machine.
The enrollment event says the key is invalid or revokedThe key was revoked in the panel or copied incompletely.Create a new key in the panel and pass it. If you will not use a key, clear it with SetEnrollKey("").
In C, skyydesk_start returns -2No event callback was given. A connection nobody sees is not allowed.Call skyydesk_set_event_callback first.
On Linux the library does not load (DllNotFoundException or "cannot open shared object file")System packages the library needs are missing.Run the command below. On Ubuntu 24.04 and later write libgtk-3-0t64 and libasound2t64.
The person connecting cannot reach the machineThe machine cannot reach the SkyyDesk servers.Open TCP 21115–21117 and UDP 21116 to rs.skyydesk.com in the firewall.
On Linux, screen sharing approval is asked on every connectionThe desktop runs on Wayland.Approve it, or sign in to an X11 session.
Debian / Ubuntu
sudo apt install libgtk-3-0 libxcb-randr0 libxdo3 libxfixes3 libxcb-shape0 libxcb-xfixes0 \
  libasound2 libsystemd0 libva2 libva-drm2 libva-x11-2 libgstreamer-plugins-base1.0-0 \
  libpam0g gstreamer1.0-pipewire libpulse0

All functions

The .NET package is a thin layer over these C functions. The list of events is on the developer page.

C.NETWhat it doesReturns
skyydesk_initnew SkyyDeskHost(dir)Starts the library. The first line of main.0; -1 without a folder
skyydesk_set_event_callbackIncoming, Closed, Enrolled eventsSets the function events are sent to.–
skyydesk_startStart(allowPassword)Makes the machine reachable. With 0, every connection waits for approval.0; -2 without a callback (.NET throws)
skyydesk_my_idMyIdThe machine's ID.length; -1 if there is no room
skyydesk_acceptAccept(id)Lets a waiting connection in.–
skyydesk_closeClose(id)Turns a connection away or ends it.–
skyydesk_passwordOneTimePasswordThe current one-time password.length; -1 if there is no room
skyydesk_new_passwordNewOneTimePassword()Generates a new one-time password.–
skyydesk_set_passwordSetPassword(pw)Sets a permanent password; an empty string removes it.0 or -1 (true/false in .NET)
skyydesk_get_optionGetOption(key)Reads a setting.length
skyydesk_set_optionSetOption, SetEnrollKeyWrites a setting. Server and account settings are refused.0; -1 if refused

Packages and a short summary are on the developer page.

Download the packages Open the panel