@qbraid-core
    Preparing search index...

    @qbraid-core

    qBraid Cloud Client Libraries for JavaScript

    npm

    Idiomatic client libraries for developing JavaScript applications that interact with qBraid Cloud Services:

    Library Release Level Version
    Base Stable npm
    File System Stable npm
    AI Chat Stable npm
    Quantum Devices Stable npm
    Quantum Jobs Stable npm
    Compute Manager Stable npm
    File Storage Stable npm
    IBM Quantum Cloud Stable npm

    If the service is not listed above but has public endpoints documented in the qBraid Cloud APIs, you can use @qbraid-core/base to interact with the service through a generic REST interface. For example:

    import { QbraidClient, QbraidSession } from '@qbraid-core/base';

    // Create session with explicit auth data
    const authData = { apiKey: 'your-api-key' };
    const session = new QbraidSession(authData);
    const client = new QbraidClient(session);

    const response = await client.session.client.get('/example/endpoint');

    Login or create an account at account.qbraid.com, and copy your API Key from the Plan info card on the left side of your account page.

    Store your API Key in the QBRAID_API_KEY environment variable, or use the qBraid CLI to save your API Key in a local configuration file.

    See qBraid Account - API Keys for more information.

    The @qbraid-core/base package is designed to work in both Node.js and browser environments. It contains only the core HTTP client functionality without any filesystem dependencies, making it safe for use in frontend applications.

    For filesystem operations (such as loading configuration files), use the @qbraid-core/fs package which requires Node.js and provides:

    • QbraidConfigManager - Filesystem-based configuration management
    • IBMConfigManager - Filesystem-based configuration manangerment for ibm cloud
    • FsConfigManager - Abstract base for filesystem config implementations
    • isRunningInLab() - Utility to detect qBraid Lab environment
    • Directory and context management utilities

    For browser/frontend applications:

    qBraid

    import { QbraidSession, QbraidClient } from '@qbraid-core/base';

    // Provide auth data directly instead of loading from config file
    const authData = { apiKey: 'your-api-key' };
    const session = new QbraidSession(authData);
    const client = new QbraidClient(session);

    // Use all client methods
    const user = await client.getUser();

    IBM

    import { IBMCloudClient} from '@qbraid-core/ibm-cloud';

    const apiKey = 'my-api-key';
    const serviceCRN = 'my-service-crn';

    const client = new IBMCloudClient(apiKey: apiKey, serviceCRN: serviceCRN);

    // Get a Job
    const jobID = 'my-ibm-job-id';
    const jobResponse = await client.getJob(jobID);
    console.log("Job details: ", jobResponse);

    For Node.js applications with config file support:

    import { QbraidConfigManager, isRunningInLab } from '@qbraid-core/fs';
    import { QbraidClient, QbraidSession, DEFAULT_USER_POOL } from '@qbraid-core/base';

    // Load config from ~/.qbraid/qbraidrc
    const configManager = new QbraidConfigManager();
    const authData = configManager.getAuthData();
    const baseURL = configManager.getUrl();
    const session = new QbraidSession(authData, DEFAULT_USER_POOL, baseURL);
    const client = new QbraidClient(session);

    // Use client methods
    const user = await client.getUser();

    // Use filesystem utilities
    const inLab = await isRunningInLab(session);
    import { IBMConfigManager, DEFAULT_IBM_CONFIG_PATH } from '@qbraid-core/fs';
    import { IbmCloudClient } from '@qbraid-core/ibm-cloud';

    // Load config from ~/..qiskit/qiskit-ibm.json
    const config = new IBMConfigManager(DEFAULT_IBM_CONFIG_PATH);
    const client = new IbmCloudClient({
    crn: config.instance,
    token: config.token,
    });

    // get devices
    const backends = await client.getBackends();

    // get jobs
    const jobs = await client.getJobs();
    • @qbraid-core/base - Core HTTP client, frontend-compatible, no filesystem dependencies
    • @qbraid-core/fs - Filesystem utilities for Node.js (config management, lab detection)
    • Other packages - Service-specific clients that extend the base functionality

    Our libraries follow Semantic Versioning.

    Please note it is currently under active development. Any release versioned 0.x.y is subject to backwards-incompatible changes at any time.

    Stable: Libraries defined at the Stable quality level are stable. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against Stable libraries are addressed with the highest priority.

    Preview: Libraries defined at the preview quality level are still a work-in-progress and are more likely to get backwards-incompatible updates.

    Deprecated: Libraries defined at the deprecated quality level are no longer supported, may contain bugs, and may be removed without warning.

    This software is proprietary and subject to the terms of the qBraid Commercial Software License.