Quickstart
From an empty workspace to a key your app accepts. You need a Sealcord account; the Console is at console.sealcord.com.
-
Create a product and its signing key
In the Console, add a product: choose its id (
acme-notes) and its key prefix (ACN1-). Sealcord generates the product’s Ed25519 signing key and keeps the private half; you copy the public half into your app. -
Issue a key by hand
From the Console, or with the Admin API, issue a licence for your own email address with a limit of one machine. The Admin API needs an admin API key with the
licences:writescope, which an owner creates on the Console’s API keys page. It readssc_, a 12-character prefix,_and the secret; keep it on your server. The examples read it from theSEALCORD_TOKENenvironment variable.Terminal window curl https://api.sealcord.com/v1/admin/licences \-H "authorization: Bearer $SEALCORD_TOKEN" \-H 'content-type: application/json' \-d '{"product_id": "acme-notes","email": "you@example.com","limit_kind": "machines","limit_count": 1}'// Node.js 18 or later, as an ES module (a .mjs file) for the top-level await.const token = process.env.SEALCORD_TOKEN;if (!token) throw new Error('SEALCORD_TOKEN is not set');const response = await fetch('https://api.sealcord.com/v1/admin/licences', {method: 'POST',headers: {authorization: `Bearer ${token}`,'content-type': 'application/json',},body: JSON.stringify({product_id: 'acme-notes',email: 'you@example.com',limit_kind: 'machines',limit_count: 1,}),});const json = await response.json();if (!response.ok) {console.error(`HTTP ${response.status}`, json);process.exit(1);}console.log(json);// Cargo.toml: reqwest = { version = "0.13", features = ["blocking", "json"] }// serde_json = "1"use reqwest::blocking::Client;use serde_json::{json, Value};fn main() -> Result<(), Box<dyn std::error::Error>> {let token = std::env::var("SEALCORD_TOKEN")?;let response = Client::new().post("https://api.sealcord.com/v1/admin/licences").bearer_auth(token).json(&json!({"product_id": "acme-notes","email": "you@example.com","limit_kind": "machines","limit_count": 1,})).send()?;let status = response.status();let body: Value = response.json()?;if !status.is_success() {return Err(format!("HTTP {status}: {body}").into());}println!("{body:#}");Ok(())}// Go 1.18 or later: go run main.gopackage mainimport ("bytes""encoding/json""fmt""log""net/http""os")func main() {token := os.Getenv("SEALCORD_TOKEN")if token == "" {log.Fatal("SEALCORD_TOKEN is not set")}url := "https://api.sealcord.com/v1/admin/licences"body, err := json.Marshal(map[string]any{"product_id": "acme-notes","email": "you@example.com","limit_kind": "machines","limit_count": 1,})if err != nil {log.Fatal(err)}req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))if err != nil {log.Fatal(err)}req.Header.Set("Authorization", "Bearer "+token)req.Header.Set("Content-Type", "application/json")res, err := http.DefaultClient.Do(req)if err != nil {log.Fatal(err)}defer res.Body.Close()var answer anyif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {log.Fatal(err)}out, _ := json.MarshalIndent(answer, "", " ")if res.StatusCode/100 != 2 {log.Fatalf("HTTP %d: %s", res.StatusCode, out)}fmt.Println(string(out))}// .NET 8 or later: the Program.cs of a console app (dotnet new console).using System.Net.Http.Headers;using System.Net.Http.Json;var token = Environment.GetEnvironmentVariable("SEALCORD_TOKEN")?? throw new InvalidOperationException("SEALCORD_TOKEN is not set");using var http = new HttpClient();http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);var response = await http.PostAsJsonAsync("https://api.sealcord.com/v1/admin/licences", new{product_id = "acme-notes",email = "you@example.com",limit_kind = "machines",limit_count = 1,});var json = await response.Content.ReadAsStringAsync();if (!response.IsSuccessStatusCode){Console.Error.WriteLine($"HTTP {(int)response.StatusCode}: {json}");Environment.Exit(1);}Console.WriteLine(json);// Java 11 or later: java Main.javaimport java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;public class Main {public static void main(String[] args) throws Exception {String token = System.getenv("SEALCORD_TOKEN");if (token == null) {throw new IllegalStateException("SEALCORD_TOKEN is not set");}String body = "{"+ "\"product_id\": \"acme-notes\", "+ "\"email\": \"you@example.com\", "+ "\"limit_kind\": \"machines\", "+ "\"limit_count\": 1"+ "}";HttpRequest request = HttpRequest.newBuilder().uri(URI.create("https://api.sealcord.com/v1/admin/licences")).header("authorization", "Bearer " + token).header("content-type", "application/json").POST(HttpRequest.BodyPublishers.ofString(body)).build();HttpResponse<String> response =HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());if (response.statusCode() / 100 != 2) {System.err.println("HTTP " + response.statusCode() + ": " + response.body());System.exit(1);}System.out.println(response.body());}}The answer,
201 Created, carries the licence and its key:{ "licence": { "id": "3c81e0a2-…", "product_id": "acme-notes" }, "key": "ACN1-…" } -
Check it in your app
Embed the public key, and verify the key offline: its signature, its product and its expiry. Then activate the machine online, and keep the signed verdict the API answers with for when the app is offline.
-
Issue from your checkout
Call the Admin API from the backend that takes payment, once per paid order, or connect Polar and map its products so its orders issue licences for you.
- Licence keys for a desktop or command-line app: what your app stores, checks and shows.
- Concepts: the words these pages use.
- Keys: what a key carries, and how to check one.
- Webhooks: hear about licence and machine changes on your own server.
- Admin API and errors: the routes your backend calls, and what each answer means.
- API reference: every route, its body and its answers.