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:
npm install ./credvault-edge-1.0.0.tgz
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:
npm install credvault-sdk
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.
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.
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.
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
authfor sign-in, sign-up, and profile callsdatafor clusters and collection dataciefor datasets, models, and predictionswebhooksfor event deliveryfunctionsfor serverless functionstriggersfor collection eventsbackupsfor backup and restoreschemafor schema and indexesapiKeysfor API key managementmetricsfor platform monitoringlogsfor activity and audit logsnotificationsfor notifications; preference methods should be checked against/api-docssettingsfor account settings, but some methods still need backend route alignmentrobotsfor robot/device endpoints, but this area still needs route alignment before it is public-readyorchestrationfor jobs, runs, assets, sensors, schedules, and launching jobslineagefor namespaces, datasets, jobs, runs, versions, search, and lineagemetadatafor tables, databases, search, and lineagenotebooksfor notebook operations and code executionpipelinesfor creating, running, and inspecting pipelinesdashboardsandalertsfor operational monitoringrealtimefor stream management and WebSocket stream URLsagentSessionsfor authenticated agent session and event calls
Platform Integrations
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:
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.