Zum Inhalt springen

Die Entwickler-Doku gibt es nur auf Englisch.

Download button

A download button hands out the release files of one product from your own website, but only against a license key that can be used now. A click opens the download window over your page. The customer enters their license key and sees the files their license is offered: per platform the newest published versions of the license's release channel and of every more stable channel, each with its size and SHA-256 checksum. A download link works for 5 minutes. Without a usable license there is no link: the window says why and offers your buy button.

Pre-release. The checkout host below is a placeholder for the address of your Noctix web app. Create download buttons on the Download buttons page of the dashboard or with the Management API.

Before you start

  1. Publish a release with files for the product (Publish releases from CI or /v1/releases).
  2. Create a download button with POST /v1/download-buttons (scope releases:write): the product, the text on the button and the allowed domains. Domains are hosts without https:// and path, such as kestrel.example, *.kestrel.example for all subdomains, or localhost:5000 for a test page.
  3. Optional: name a buy button of the same product (buy_button_id). The window offers it to customers whose license cannot download.
  4. Note the button ID (dbt_...).
curl https://api.example.com/v1/download-buttons \
  -H "Authorization: Bearer mk_live_..." -H "Content-Type: application/json" \
  -d '{"product_id": "prod_...", "label": "Download Kestrel CAD", "allowed_domains": ["kestrel.example"], "buy_button_id": "bbt_..."}'

The browser loads the button and the window only on the allowed domains. On any other site the frame stays empty. With no allowed domains, only the direct link works. PATCH /v1/download-buttons/{id} changes text, domains, buy button (null removes it) and active; an inactive button hands out nothing.

Embed the button

Put this where the button should appear:

<script src="https://checkout.example/embed/download.js" data-button="dbt_..." async></script>
Attribute Values Default
data-button The button ID required
data-locale en, de en
data-size sm (28 px), lg (44 px), or leave it out (36 px) 36 px

The button brings its own font and shape and takes nothing from your page's styles. Its color is the accent color from your branding settings. Name it after the product, such as "Download Kestrel CAD".

Know when a download starts

document.addEventListener("noctix:download.started", (event) => {
  const { button, file } = event.detail;
  // Show installation steps, for example.
});

The event carries the button ID and the file ID only, never the license key or the link. Every link is also recorded as license.file_downloaded with via: "download_button" in the audit log of the license.

Other ways to offer downloads

  • Direct link: https://checkout.example/en/download/dbt_... opens the window as its own page, for emails or a link on any site. It works without allowed domains.

  • Your own iframe: embed the window in your page instead of the overlay. Give it room for the whole window (at least 440 by 560 px). It posts { type: "noctix:download.started", button, file } to your page; check that event.origin is the checkout host.

    <iframe src="https://checkout.example/en/download/dbt_..." title="Download" width="480" height="640"></iframe>
    
  • The license portal offers the same files to signed-in customers, and the window links to it for customers who look for their key.

  • In your app the SDK downloads updates itself (Rust SDK).

Limits

  • A license gets at most 30 download links an hour, counted together with the portal.
  • Key checks count per client address: at most 30 in 10 minutes.
  • Encrypted release files open only on a device through the SDK, so the window leaves them out.
  • A license that is suspended, paused, revoked or past its end and the plan's grace days gets no link.