Embed SkyyDesk in your own application
Add one library to your application and the machine it runs on can be reached from SkyyDesk. Nothing else is installed. Whoever connects, your application decides whether they get in. Servers, accounts and licences stay with us.
Adding it for the first time? Follow the step-by-step guide, with a screenshot for every step.
Each package holds the library, examples and the setup guide (README); the Windows and Linux packages also hold the C header, the Android package a Kotlin example. The .NET package comes from here, not from nuget.org: put it in a folder and add that folder as a package source.
Five steps
- Put the library next to your applicationskyydesk.dll and the DLLs next to it on Windows, libskyydesk.so on Linux, the .aar file in the libs folder on Android. The system packages Linux needs and Android's two dependencies are listed in the README.
- Call skyydesk_init on the first line of mainThe library starts a few copies of your application for its own helper work; those copies exit inside skyydesk_init. Code you put before it runs in them too.
- Set the event callbackWithout a callback the library does not start: a connection nobody can see or approve is not allowed.
- Set your enrollment keyOptional. A machine given the key appears by itself in the key owner's address book.
- Call skyydesk_start and show the IDShow the machine's SkyyDesk ID (and the one-time password, if you allow passwords) to whoever will connect.
In your language
All four call the same C functions. Complete, working examples are in the package's examples folder.
// .NET 8 or .NET 10, package SkyyDesk using SkyyDesk; var desk = new SkyyDeskHost(Path.Combine(AppContext.BaseDirectory, "skyydesk-data")); desk.Incoming += (_, c) => { if (c.Authorized) return; // Ask your user, then: desk.Accept(c.Id); // or desk.Close(c.Id) }; desk.Enrolled += (_, r) => Console.WriteLine(r.Ok ? "in the address book" : r.Error); desk.SetEnrollKey("sdk_..."); desk.Start(allowPassword: false); Console.WriteLine($"SkyyDesk ID {desk.MyId}");
/* cc app.c -L. -lskyydesk -Wl,-rpath,'$ORIGIN' */ #include "skyydesk.h" static void on_event(int kind, const char *payload, void *user) { if (kind == SKYYDESK_EVENT_INCOMING) { /* payload is JSON: "id", "name", "peer_id", "authorized" */ } } int main(void) { char id[32]; skyydesk_init("./skyydesk-data"); /* first line of main */ skyydesk_set_event_callback(on_event, NULL); skyydesk_set_option("enroll-key", "sdk_..."); skyydesk_start(0); /* 0: every connection waits for skyydesk_accept */ skyydesk_my_id(id, sizeof id); }
// JNA 5.x, no JNI code to compile public interface SkyyDesk extends Library { SkyyDesk LIB = Native.load("skyydesk", SkyyDesk.class); interface EventCb extends Callback { void invoke(int kind, String payload, Pointer user); } int skyydesk_init(String appDir); void skyydesk_set_event_callback(EventCb cb, Pointer user); int skyydesk_set_option(String key, String value); int skyydesk_start(int allowPassword); void skyydesk_accept(int connection); int skyydesk_my_id(byte[] out, int len); } // Keep the callback in a field so it is not collected. static final SkyyDesk.EventCb ON_EVENT = (kind, payload, user) -> { /* ... */ }; SkyyDesk.LIB.skyydesk_init("skyydesk-data"); SkyyDesk.LIB.skyydesk_set_event_callback(ON_EVENT, null); SkyyDesk.LIB.skyydesk_start(0);
{ uses SkyyDesk; unit in examples/delphi } procedure OnEvent(Kind: Integer; Payload: PAnsiChar; User: Pointer); cdecl; begin { Library thread: use TThread.Queue before touching a form. } if Kind = SKYYDESK_EVENT_INCOMING then Writeln('incoming: ', UTF8ToString(Payload)); end; var Buf: array[0..63] of AnsiChar; begin skyydesk_init('skyydesk-data'); skyydesk_set_event_callback(OnEvent, nil); skyydesk_set_option('enroll-key', 'sdk_...'); skyydesk_start(0); skyydesk_my_id(Buf, SizeOf(Buf)); end.
The callback runs on a library thread. Move to your UI thread before touching a window.
Events
| Kind | Payload | What you do |
|---|---|---|
| 1: connection request | JSON: id, name, peer_id, authorized | if authorized is false, call skyydesk_accept(id) or skyydesk_close(id) |
| 2: connection closed | connection number | update the status in your window |
| 3: enrollment result | {"ok":true} or {"ok":false,"error":"..."} | an invalid or revoked key shows here |
| 4: voice call | the JSON of 1, plus incoming_voice_call and in_voice_call | if incoming_voice_call is true, ask the user and call skyydesk_answer_voice_call(id, 1 or 0); skyydesk_end_voice_call(id) hangs up |
Let machines land in your address book by themselves
Create a key in the panel under Settings → Enrollment keys. The key is shown once, when it is created. As soon as your application has it, the machine appears in your account's address book. Revoke the key in the panel and no new machines are added; those already added stay.
skyydesk_set_option("enroll-key", "sdk_...");
The machine itself uses no licence; the person who connects does. There is no limit on the number of machines.
Platforms
| Platform | Can be the machine connected to | Note |
|---|---|---|
| Windows 10/11 | Yes | |
| Linux (X11) | Yes | On Wayland the user approves screen sharing in every session. |
| Android 7+ | Yes | The user allows screen recording each time sharing starts, and switches on SkyyDesk Input once for touch. 64-bit phones only. |
| iOS | No | iOS does not let an app control the screen. |
| Web page | No | A browser does not let a page control the computer. To connect from your web application, see below. |
Connecting from your web application
Your web application cannot be the machine connected to, but it can be the side that connects: a link that takes your user to the machine's session is enough.
<a href="https://skyydesk.com/webclient2/?id=123456789" target="_blank" rel="noopener">Connect</a>
- Open the session in a new tab. The session page does not open inside another site's frame (iframe); the browser blocks it.
- To watch only, add
&view=1to the address; mouse and keyboard do not reach the other machine. - The person connecting signs in with a SkyyDesk account and uses their own licence. No password or account details go in the address.
- The ID does not stay in the address bar: the session page removes it as soon as it opens.