You can add Ariadne Mark to a JavaScript or mobile product by running its Python SDK or CLI in your own Linux backend worker. The app keeps its existing generation flow; the worker marks the final file before publishing it to object storage or returning a download.
Ariadne Mark 0.7.2a1 is not an npm marking package or an on-device iOS/Android SDK. The qualified media runtime is Linux x86-64 / Python 3.12 on CPU. Provision it with the release quickstart.
A practical Next.js or mobile-app pipeline
| Stage | Your app or API | Linux media worker |
|---|---|---|
| Generate | Submit a job and show progress | Receive the final supported image/video from the generator |
| Prepare | Record actual product and generation facts | Finish crops, resizing, overlays and encoding |
| Mark | Keep the request lifecycle separate from long-running work | Export through the SDK; retain receipt and registry entry |
| Publish | Return the completed asset URL | Publish the returned marked file only after success |
| Verify | Link recipients to your verifier where applicable | Keep verifier and recovery registry available |
For a Next.js server route, enqueue the task and return a job ID. Process it outside the request lifecycle. A short-lived edge/serverless function is not the qualified media environment; use it to coordinate an owned backend worker rather than running inference in it.
Call the CLI from a Node.js background worker
The following downloadable node-image-worker.mjs exports a new image and invokes Verify separately. It uses development credentials for evaluation. Its paths and product facts must come from your server-owned job record, not arbitrary browser input.
// Development-only CLI bridge, executed inside an owned Linux background worker.
// Paths and product facts come from your job record, never arbitrary browser input.
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
const exec = promisify(execFile);
export async function exportImage(job) {
const args = ['mark', job.input, job.output,
'--publisher', job.publisher, '--system', job.system,
'--system-version', job.systemVersion, '--created-at', job.createdAt,
'--identity', job.identity, '--allow-dev', '--registry', job.registry];
const options = { shell: false, timeout: 300_000, maxBuffer: 2 * 1024 * 1024,
env: process.env };
const { stdout } = await exec('ariadne', args, options);
const receipt = JSON.parse(stdout);
const verified = await exec('ariadne', ['verify', job.output,
'--registry', job.registry], options);
return { receipt, verification: JSON.parse(verified.stdout) };
}
The job contains input, output, publisher, system, systemVersion, createdAt, identity and registry. createdAt is the actual generation timestamp with timezone. Run ariadne init-dev in a fresh evaluation directory before using this development example. The runtime and models must already be installed.
execFile passes an argument array without a shell. A non-zero exit or timeout rejects the job. Reconcile job state and outputs before retrying: a timeout alone does not prove that the full child-process tree has stopped. Use cancellation at your queue/container boundary.
Use a persistent Python worker for sustained throughput
The CLI bridge is a simple integration boundary, but starts a new process on each invocation. For a busy generator, create one Python SDK per long-lived worker and feed it jobs through your existing queue. Reuse its models between exports and bound concurrency.
The Python guide shows the reusable function. The release measurements distinguish the first export from resident repeats; cost planning connects CPU work to a daily workload.
What changes for video?
The CLI supports --video-profile economy_5s, economy_2s or resilient. Supply the real creation time and a truthful audio declaration. Finish each crop, resize and encode before marking that final rendition.
Economy profiles reduce watermark inference while the entire video still passes through decoding and encoding. Use the video-profile guide for short clips, sampling and known transformation limits. This kit does not independently mark generated audio.
Can I expose the kit as my marking API?
The supplied public HTTP service is a verifier. Your generation/marking endpoint is part of your own authenticated application and queue. Keep signing keys, local file paths and the registry off user devices. Return product-level job status rather than exposing raw CLI arguments or server paths.
For production, configure your actual signing identity, trust, persistence and verifier endpoint through the deployment kit and production guide. The example's --allow-dev flag is for evaluation.
First export · Supported media · Test the real hero · Application requirements checklist