CompRes™ Docs.

CompRes (Compression & Resolution) is a high-efficiency media and document optimization service. It drastically reduces file sizes (up to 99% for documents) by decoupling structural data from content, returning highly compressed "DNA" payloads that are reconstructed dynamically on the client side.

Core Concepts

CompRes converts standard files into optimized symbolic representations called DNA Streams. Because these streams are custom formats, standard browsers cannot display them natively. Instead, they are rendered back into their original visual state using our Universal Viewer.

D-DNA (Documents)

Transforms PDFs and DOCX files into structural DNA payloads, achieving up to 99% compression. Fully rebuilds document layouts client-side.

A-DNA (Audio)

Generates ultra-low bitrate perceptual voice streams and visual waveform signatures, designed for minimal bandwidth consumption.

V-DNA (Video)

Extracts intelligent "Motion Strips" to create instant, 0ms visual previews and summarized motion graphs for heavy video files.

1. SDK Installation

Include the Javascript SDK directly in your HTML. You need both the SDK for API interaction and the Universal Viewer for rendering D-DNA files.

<!-- 1. CompRes API Client SDK -->
<script src="https://connekt.social/static/sdk/compres-service/compres-sdk-v1.js"></script>

<!-- 2. CompRes Universal Viewer (For rendering documents and media) -->
<script src="https://connekt.social/static/sdk/compres-service/compres-viewer-v1.js"></script>
<link rel="stylesheet" href="https://connekt.social/static/sdk/compres-service/compres-viewer-v1.css">

2. Secure Initialization

Instantiate the SDK using your Public API Key. Because CompRes uses strict security, you must perform an RACP (Robust Agent Communication Protocol) handshake. This means your backend must generate an HMAC-SHA256 signature using your Secret Key and pass it to your frontend.

const sdk = new CompResSDK("YOUR_PUBLIC_API_KEY");

// Retrieve these values from your backend
const timestamp = 1712560000; 
const signature = "HMAC_SHA256(payload, 'YOUR_SECRET_KEY')"; 

// Initialize the secure session
const isReady = await sdk.initialize(signature, timestamp);

if (isReady) {
    console.log("CompRes is ready to use!");
}

Security Note: Never expose your Secret Key in your frontGreat aend Javascript code. The signature must always be generated securely on your server.

3. Compressing Files (Upload)

Use the optimize() method to compress a standard file. CompRes automatically detects the file type (Document, Audio, Video) and processes it into a lightweight DNA stream.

// Assuming `file` is obtained from an 
const result = await sdk.optimize(file);

if (result) {
    // The DNA Token you should save to your database
    console.log("Database Token:", result.token); 
    
    // Detailed compression metrics
    console.log("Bandwidth Saved:", result.metrics.savings.toFixed(2) + "%");
    
    // Optional: Raw compressed binary payload
    console.log("Payload:", result.compressedData);
}

4. Resolving & Viewing

When a user wants to view a file, fetch the DNA payload using resolveDNA() and mount it directly into an empty HTML container using the Universal Viewer.

<!-- Your UI Container -->
<div id="document-container" style="height: 600px; width: 100%;"></div>

<script>
// 1. Fetch the DNA package using the stored token
const dnaResult = await sdk.resolveDNA("KUFv3|DOC|abc123xyz...");

if (dnaResult) {
    // 2. Mount it into the UI container
    await sdk.mountViewer('document-container', dnaResult);
}
</script>

Alias Note: You can also use getDNA() or fetchDNA() interchangeably with resolveDNA() for cache resilience.

Real-Time Heartbeat

For real-time streaming applications (e.g., live voice or video calls), CompRes can dynamically adjust bandwidth. Send periodic perceptual data (like user motion or audio levels) to the CompRes "Brain", which will return a Binary Action Token (BAT) to adjust your stream's fidelity on the fly.

const batToken = await sdk.sendHeartbeat({
    faceMotion: 0.8,    // Scale: 0.0 to 1.0
    bodyMotion: 0.2,    
    audioEnergy: 0.1    
});

if (batToken) {
    // Apply the 46-byte BAT to adjust your WebRTC/Streaming logic
    applyNetworkAdaptation(batToken);
}

Legacy & Direct Binary

For legacy integrations built before the Universal Viewer, or applications that just need raw optimized file blobs (similar to TinyPNG), you can skip the DNA reconstruction flow entirely and use the returned optimized binary directly.

const result = await sdk.optimize(file);

// The `compressedData` field contains the raw, optimized binary
const rawBlob = result.compressedData;

// You can use this directly in your application
// e.g., Uploading to S3, saving to disk, or creating an Object URL
const url = URL.createObjectURL(new Blob([rawBlob]));
document.getElementById('my-image').src = url;

Server-Side (REST API)

If you are building a mobile application or prefer to handle CompRes entirely from your backend, you can bypass the Javascript SDK and call the REST API directly. The base URL is https://api.connekt.social/v1/compres-service.

1. Initialize Secure Session (RACP)

Establish an active session to retrieve an Ephemeral Secret.

curl -X POST https://api.connekt.social/v1/compres-service/session/init \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_PUBLIC_API_KEY" \
  -H "X-Connekt-Timestamp: 1712560000" \
  -H "X-Connekt-Signature: HMAC_SHA256(payload, YOUR_SECRET_KEY)" \
  -d '{"device": "backend-node"}'

2. Optimize (Upload) File

Send a file as multipart/form-data to compress it and receive the DNA Token.

curl -X POST https://api.connekt.social/v1/compres-service/optimize \
  -H "X-API-Key: YOUR_PUBLIC_API_KEY" \
  -F "file=@/path/to/your/document.pdf"

Response: { "status": "success", "token": "KUFv3|DOC|...", "metrics": { "savings": 95.4 } }

3. Resolve DNA Token

Fetch the reconstructed payload for a stored DNA token. Requires an active Session ID.

curl -X GET https://api.connekt.social/v1/compres-service/resolve/KUFv3|DOC|... \
  -H "X-API-Key: YOUR_PUBLIC_API_KEY" \
  -H "X-Session-ID: YOUR_ACTIVE_SESSION_ID"

Important: The raw resolved data still requires a compatible client-side decoder (like the Universal Viewer) or native mobile reconstruction logic to be rendered visually, as it is a symbolic stream (DNA).

Pricing designed for Africa

CompRes does not use standard Silicon Valley SaaS pricing. We built this infrastructure to serve solo developers, hungry startups, and scale-ups solving real bandwidth bottlenecks across Africa. Our pricing is calibrated to remove friction while aggressively scaling with your success.

Hacker / Free

$0 / forever

  • • Ideal for MVPs & testing
  • • 50 Sessions / day
  • • 200 Media Optimizations / day
  • • Requires "Powered by CompRes" badge on frontend UI
Get Started
Most Popular

Developer

$5.00 / month

  • • For solo devs & small projects
  • • 500 Sessions / day
  • • 2,000 Media Optimizations / day
  • • 100% White-labeled (No Watermark)
Subscribe via Connekt Pay 💳

Pro / Scale

$15.00 / month

  • • For revenue-generating startups
  • • 5,000 Sessions / day
  • • 10,000 Media Optimizations / day
  • • Priority African-node routing
Subscribe via Connekt Pay 💳

Enterprise

$35.00+ Custom / month

  • • Unmetered Sessions & Optimizations
  • • Dedicated On-Premise / VPC Deployment
  • • 24/7 Kufrashe Tech Support
Subscribe via Connekt Pay 💳

CompRes™ Early Access

We're onboarding select developers and enterprise partners who are building for African networks. Every application is reviewed personally by our technical team.