Senzing Node.js SDK
    Preparing search index...

    Class SzEnvironment

    Index

    Constructors

    • Creates a new SzEnvironment instance.

      Uses the singleton pattern via SzEnvironmentCore::get_instance().

      Parameters

      • moduleName: string
      • settings: string
      • OptionalverboseLogging: boolean

      Returns SzEnvironment

    Methods

    • Checks if the environment has been destroyed.

      Returns boolean

    • Checks if the environment has been destroyed.

      Returns boolean

      if (env.isDestroyed()) {
      throw new Error("Environment is no longer available");
      }
      const engine = env.getEngine();
    • Destroys the environment and releases native resources.

      After calling destroy, this wrapper is no longer usable.

      Returns void

    • Destroys the environment and releases native resources.

      Returns void

      const env = new SzEnvironment("myApp", settings);
      try {
      const engine = env.getEngine();
      engine.addRecord("CUSTOMERS", "1001", recordJson);
      } finally {
      env.destroy();
      }
    • Reinitializes the environment with a different configuration.

      Parameters

      • configId: number

      Returns void

    • Reinitializes the environment with a different configuration.

      Parameters

      • configId: number

      Returns void

      const configMgr = env.getConfigManager();
      const configDef = configMgr.createConfig();
      const configId = configMgr.setDefaultConfig(configDef, "added data sources");
      env.reinitialize(configId);
    • Gets the currently active configuration ID.

      Returns number

    • Gets the currently active configuration ID.

      Returns number

      const activeId = env.getActiveConfigId();
      console.log(`Active configuration ID: ${activeId}`);
    • Creates a new SzEnvironment instance.

      Parameters

      • moduleName: string
      • settings: string
      • OptionalverboseLogging: boolean

      Returns any

      import { SzEnvironment } from "@senzing/sz-sdk";

      const env = new SzEnvironment("myApp", settings);
      try {
      const engine = env.getEngine();
      // ... use engine ...
      } finally {
      env.destroy();
      }