Platform
Documentation

The ultimate guide to building, deploying, and integrating applications within the KJClernt Pro Gaming OS ecosystem.


Quickstart Setup

To interact with the core engine programmatically, you must install the official JavaScript SDK. This injects the global context into your application.

npm install @kjclernt/sdk --save
yarn add @kjclernt/sdk

Authentication Loop

The platform uses a Clerk-backed engine. Protecting a page requires checking the global state before removing the #auth-loader screen to prevent layout shifts.

auth-guard.js
window.addEventListener('load', async function() {
    await window.Clerk.load();
    
    // Validate Token
    if (!window.Clerk.user) {
        window.location.replace("https://kjclernt.io/auth/login");
        return; 
    }
    
    // Mount UI
    document.getElementById('auth-loader').style.opacity = '0';
});

Window Manager API

Applications are rendered inside a glassmorphic iframe overlay. You must use the postMessage API to transmit credentials securely across DOM boundaries.

X-Frame-Options Header

Ensure external apps allow framing from https://kjclernt.io or the browser will block the render entirely. Standard CORS rules apply.

app-launcher.js
function openApp(url, title) {
    const iframe = document.getElementById('app-iframe');
    document.getElementById('os-window').classList.add('active');
    
    iframe.src = url;
    
    // Pass token securely on load
    iframe.onload = async () => {
        const token = await window.Clerk.session.getToken();
        iframe.contentWindow.postMessage({ token }, url);
    };
}

Fetch User Data

Interact with platform data programmatically. Endpoints require a valid Bearer token in the Authorization header.

GET /api/v1/users/me

Retrieves encrypted profile data based on the Authorization header.

curl -H "Authorization: Bearer " https://api.kjclernt.io/v1/users/me

Response

{
  "status": 200,
  "data": {
    "user_id": "usr_2b9x8",
    "tier": "pro_access"
  }
}
Last updated: May 3, 2026