Claron
    COMPILER PLUGINS

    SDK Integration

    Integrate the Claron SDK into your build workflow. The SDK compiles secure, opaque source mapping hashes directly into your application, unlocking exact file/line bug positioning and automated AI fixes in production without exposing your code structures.

    SECURITY POLICY

    ZERO-CONFIG BUNDLER SETUP

    Install @claron/sdk, then load the plugin in your framework configuration with zero arguments. It automatically resolves keys from your local environment variables or configuration files.

    bash
    $ npm install --save-dev @claron/sdk

    Next.js Setup

    EXPLORER
    next.config.ts×
    +
    typescript
    1import { withClaron } from '@claron/sdk/next'
    2
    3export default withClaron()({
    4 // Your normal nextConfig
    5})
    next.config.tsLn 5, Col 1TYPESCRIPTUTF-8

    Vite Setup

    EXPLORER
    vite.config.ts×
    +
    typescript
    1import { defineConfig } from 'vite'
    2import { claronVitePlugin } from '@claron/sdk/vite'
    3
    4export default defineConfig({
    5 plugins: [claronVitePlugin()]
    6})
    vite.config.tsLn 6, Col 1TYPESCRIPTUTF-8

    EXPECTED SDK OUTPUTS

    Compilation & Build Outputs

    data-claron-src Injection
    Instrumented JSX/TSX elements receive an opaque encrypted source token: <button data-claron-src="cl1....">.
    Local Manifest
    Creates .claron/locations-manifest.json with loc1.<digest> entries and source file, line, and column metadata for deployment indexing.
    Source Map Payload
    Gzips and uploads source maps plus the manifest to /api/v1/sdk/deployments; the API stores them privately in R2.

    EDGE CASES & COMPILER BEHAVIOR

    Compiler Safeguards & Fallbacks

    Missing API Keys
    If CLARON_PROJECT_ID or CLARON_API_KEY is missing, the build logs a warning and skips deployment upload. The build does NOT fail.
    Non-Production Builds
    Production is enabled by default; set CLARON_ENABLED=false to disable tagging and uploads. Development environments stay disabled unless explicitly enabled.
    Dynamic / Runtime Elements
    Elements created dynamically at runtime via innerHTML do not have build-time data-claron-src tokens; the extension falls back to durable DOM context and selectors.
    Third-Party Libraries
    Libraries in node_modules are excluded; annotations fall back to the closest parent element with a valid data-claron-src or durable target identity.

    WHAT TO DO IF THE SDK FAILS