ENGINEERING // CLIENT_LIBRARIES

    CLIENT LIBRARIES.

    Three languages, generated from the same contract that powers the reference. PixelBridge, the TypeScript SDK, and the Python client are all installable today.

    BROWSER

    PixelBridge (web)

    <script async src="https://sdk.qubitnotion.com/v1/sdk.js"></script>
    First-party event collection
    Consent gating before any event fires
    Event deduplication with server events
    No third-party cookies
    AVAILABLE
    BROWSER, TYPED

    @qubitnotion/pixel

    npm install @qubitnotion/pixel
    Typed wrapper over the hosted pixel script
    Consent-first: nothing identifiable before you call consent
    Email and phone hashed in the browser
    Safe to import in server-rendered code
    RELEASE PENDING
    TYPESCRIPT / JAVASCRIPT

    @qubitnotion/sdk

    npm install @qubitnotion/sdk
    Covers every live /api/v1 endpoint
    Full TypeScript definitions
    Automatic retry honouring Retry-After
    Pagination helper over limit and offset
    AVAILABLE
    PYTHON 3.10+

    qubitnotion

    pip install qubitnotion
    Standard library only, no dependencies
    Same methods and errors as the TypeScript client
    Automatic retry honouring Retry-After
    Pagination helper over limit and offset
    AVAILABLE

    INITIALIZATION_SEQUENCE

    QUICK START

    PixelBridge, available today
    <script>
    (function(w,d,s){
      w.QubitNotion = w.QubitNotion || function(){
        (w.QubitNotion.q = w.QubitNotion.q || []).push(arguments);
      };
      w.QubitNotion.p = 'YOUR_PIXEL_CODE';
      w.QubitNotion.e = 'https://sdk.qubitnotion.com/v1/ingest';
      var f = d.getElementsByTagName(s)[0], j = d.createElement(s);
      j.async = true; j.src = 'https://sdk.qubitnotion.com/v1/sdk.js';
      f.parentNode.insertBefore(j, f);
    })(window, document, 'script');
    
    // Nothing is collected until consent is granted
    QubitNotion('consent', { analytics_storage: 'granted', ad_storage: 'denied' });
    
    QubitNotion('event', 'purchase', {
      value: 249.00,
      currency: 'AED',
      event_id: 'ord_10482'   // deduplicates against your server event
    });
    </script>
    TypeScript SDK, available today
    import { createClient } from '@qubitnotion/sdk';
    
    const qn = createClient({
      apiKey: process.env.QUBIT_NOTION_API_KEY,
      baseURL: 'https://api.qubitnotion.com/v1',
    });
    
    // Send a batch of server-side events
    await qn.events.createBatch({
      events: [
        { type: 'purchase', user_id: 'usr_123', value: 249.00, currency: 'AED' }
      ]
    });
    
    // Paginate through plans
    for await (const page of qn.plans.list({ limit: 20 })) {
      console.log(page.id);
    }
    Python SDK, available today
    from qubitnotion import QubitNotion
    
    qn = QubitNotion(api_key="qn_live_...")
    
    # Send a batch of server-side events
    qn.track("8f3c...-pixel-uuid", [
        {
            "event_id": "ord_10482",
            "event_name": "purchase",
            "value": 249.00,
            "currency": "AED",
            "identity": {"email": "buyer@example.com"},
            "consent": {"analytics": True, "marketing": True},
        }
    ], idempotency_key="ord_10482")
    
    # Paginate through plans
    for plan in qn.paginate("/api/v1/plans", limit=20):
        print(plan["id"])

    Your pixel id and installation snippet are in the workspace under PixelBridge. Workspace API keys can be created by admins in App Studio once the REST API v1 beta is enabled.

    RETURN TO ENGINEERING TERMINAL