Node.js SDK

The local Node.js SDK package is named credvault-edge and is version 1.0.0. The SDK code includes TypeScript definitions and exposes a CredVault client with resources for data, CIE, webhooks, functions, triggers, backups, schema, API keys, metrics, logs, notifications, settings, robots, orchestration, lineage, metadata, notebooks, pipelines, dashboards, alerts, realtime streams, and agent sessions.

Installation

Install from the local package artifact provided by CredVault:

Terminal
npm install ./credvault-edge-1.0.0.tgz
What you should seeA completed package install with no dependency errors.

What you should see: npm should add the package to your project. Your package.json should include credvault-edge, and your code editor should recognize the CredVault import.

The following name is not the current Node.js SDK package:

Terminal
npm install credvault-sdk
What you should seeA completed package install with no dependency errors.

The public npm package credvault-cie is the CLI package, not this Node.js application SDK.

Connecting to CredVault

The SDK defaults to http://localhost:5000/api, which is only for local backend development. Production apps must pass the CredVault backend API URL.

JavaScript
import { CredVault } from "credvault-edge";

const credvault = new CredVault({
  apiKey: process.env.CREDVAULT_API_KEY,
  baseUrl: "https://<your-credvault-backend>/api",
});

const customers = await credvault.data.query("customers", {
  status: "active",
});

console.log(customers);

What you should see: an array or paginated response containing matching records. If the API key is invalid, you should see an authentication error from CredVault rather than a JavaScript import error.

Use apiKey for server-to-server data routes such as /api/v1/data. Use token when acting on behalf of a signed-in user for routes such as clusters, functions, webhooks, logs, settings, and API-key management.

Working with Data

The data resource calls the platform's data and cluster APIs.

JavaScript
const customers = await credvault.data.query("customers", {
  status: "active",
});

await credvault.data.insert("customers", {
  name: "Acme Ltd",
  status: "active",
});

What you should see: the query returns existing customers records, and the insert call creates a new customers document that appears in the dashboard.

Use the dashboard or API docs to confirm collection names and request fields before shipping production code.

CIE

The CIE resource is for Intelligence Engine workflows such as datasets, training, and predictions.

JavaScript
const models = await credvault.cie.listModels();
const prediction = await credvault.cie.predict("model-id", {
  amount: 1200,
  region: "emea",
});

For terminal workflows, users can also use the cie CLI.

Available Resources

  • auth for sign-in, sign-up, and profile calls
  • data for clusters and collection data
  • cie for datasets, models, and predictions
  • webhooks for event delivery
  • functions for serverless functions
  • triggers for collection events
  • backups for backup and restore
  • schema for schema and indexes
  • apiKeys for API key management
  • metrics for platform monitoring
  • logs for activity and audit logs
  • notifications for notifications; preference methods should be checked against /api-docs
  • settings for account settings, but some methods still need backend route alignment
  • robots for robot/device endpoints, but this area still needs route alignment before it is public-ready
  • orchestration for jobs, runs, assets, sensors, schedules, and launching jobs
  • lineage for namespaces, datasets, jobs, runs, versions, search, and lineage
  • metadata for tables, databases, search, and lineage
  • notebooks for notebook operations and code execution
  • pipelines for creating, running, and inspecting pipelines
  • dashboards and alerts for operational monitoring
  • realtime for stream management and WebSocket stream URLs
  • agentSessions for authenticated agent session and event calls

Platform Integrations

JavaScript
const jobs = await credvault.orchestration.listJobs();
await credvault.orchestration.runJob("daily_customer_refresh");

const lineage = await credvault.lineage.getLineage({
  nodeId: "dataset:customers",
  depth: 3,
  direction: "DOWNSTREAM",
});

const metadata = await credvault.metadata.search({ q: "customers" });

const pipelineRun = await credvault.pipelines.run("pipeline-id");
const dashboardData = await credvault.dashboards.data("dashboard-id");

await credvault.alerts.recordMetric("alert-id", 92.5);

What you should see: each call should return the platform resource it touched, such as job lists, lineage results, metadata matches, pipeline run state, dashboard data, or metric acknowledgement.

Security

Keep API keys in environment variables:

Terminal
export CREDVAULT_API_KEY="..."

Never put API keys in frontend browser code. This SDK should be used from trusted backend code, scripts, workers, and CI jobs.