Node.js/TypeScript bindings for Senzing v4 entity resolution, built with NAPI-RS.
| Package | Description | Runtime Required |
|---|---|---|
| @senzing/sdk | Entity resolution engine bindings: add records, resolve entities, search, analyze relationships, manage configurations | Yes |
| @senzing/configtool | Pure JSON manipulation of Senzing configuration documents. Works anywhere Node.js runs. | No |
npm install @senzing/sdk @senzing/configtool
import { SzEnvironment, SzFlags } from "@senzing/sdk";
import { addDataSource } from "@senzing/configtool";
const settings = JSON.stringify({
PIPELINE: {
CONFIGPATH: "/opt/senzing/er/resources/templates",
RESOURCEPATH: "/opt/senzing/er/resources",
SUPPORTPATH: "/opt/senzing/data",
},
SQL: { CONNECTION: "sqlite3://na:na@/tmp/senzing.db" },
});
const env = new SzEnvironment("my-app", settings);
try {
// Bootstrap configuration with data sources
const cm = env.getConfigManager();
let cfg = cm.createConfig();
cfg = addDataSource(cfg, { code: "CUSTOMERS" });
env.reinitialize(cm.setDefaultConfig(cfg, "Initial config"));
// Add and resolve records
const engine = env.getEngine();
engine.addRecord(
"CUSTOMERS",
"1001",
JSON.stringify({ NAME_FULL: "Robert Smith", DATE_OF_BIRTH: "1985-02-15" }),
SzFlags.WITH_INFO,
);
// Search by attributes
const result = engine.searchByAttributes(
JSON.stringify({ NAME_FULL: "Bob Smith" }),
undefined,
SzFlags.SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS,
);
console.log(JSON.parse(result));
} finally {
env.destroy();
}
Browse the full API reference using the sidebar navigation:
| Platform | Architecture | @senzing/sdk | @senzing/configtool |
|---|---|---|---|
| macOS | arm64 | Yes | Yes |
| Linux | x64 | Yes | Yes |
| Linux | arm64 | Yes | Yes |
| Windows | x64 | Yes | Yes |
The repository includes 6 full examples and 27 focused code snippets covering:
| Category | Topics |
|---|---|
| Information | Version, license, performance benchmarks |
| Initialization | Environment lifecycle, engine priming, purge |
| Configuration | Config creation, data source registration |
| Loading | Single records, batch with info, worker pools |
| Searching | Attribute search, why analysis, worker pools |
| Deleting | Single delete, batch deletion |
| Redo | Continuous processing, worker pools, with info |
| Error Handling | Error inspection, retry with backoff |
| Stewardship | Force resolve, force unresolve |
| ConfigTool | Offline editing, batch scripts |