@qbraid-core
    Preparing search index...

    Lightweight, browser-safe IBM Quantum Platform config wrapper.

    • In-memory only (no filesystem operations).
    • Provides helpers for API key (token) and service CRN (instance).
    • Maintains an in-memory bearer token with simple expiry logic.
    Index

    Constructors

    Methods

    • Get the IBM API key (stored as 'token').

      Returns string

      The API key string.

    • Get the in-memory bearer token (not persisted).

      Returns string

      The bearer token string.

    • Get a shallow copy of the current configuration object. Note: nested section objects are not deeply cloned.

      Returns IBMConfigData

      A shallow copy of the current configuration.

    • Get a configuration section by name.

      Parameters

      • section: string

        The section key.

      Returns undefined | Record<string, string | boolean>

      The section object if present, otherwise undefined.

    • Get the IBM Quantum service CRN (stored as 'instance').

      Returns string

      The service CRN string.

    • Get a value from a given section.

      Parameters

      • section: string

        The section key.

      • key: string

        The key within the section.

      Returns undefined | string | boolean

      The value if present, otherwise undefined.

    • Bearer token expiry check. Returns true if token was never set or lifetime exceeded.

      Returns boolean

    • Set the IBM API key (stored as 'token').

      Parameters

      • apiKey: string

        The API key.

      Returns void

    • Set the in-memory bearer token (not persisted).

      Parameters

      • token: string

        The bearer token value.

      Returns void

    • Set the IBM Quantum service CRN (stored as 'instance').

      Parameters

      • crn: string

        The service CRN value.

      Returns void

    • Set a value within a section, creating the section if needed.

      Parameters

      • section: string

        The section key.

      • key: string

        The key within the section.

      • value: string | boolean

        The value to set.

      Returns void

    • Shallow-merge top-level sections from the provided config into the current config.

      • Existing sections are preserved unless overwritten by the same section key in newConfig.
      • For a given section key, the entire section object is replaced (no deep merge of keys). Use setValue()/specific setters for per-key updates.

      Parameters

      • newConfig: IBMConfigData

        The partial configuration to merge at the section level.

      Returns void