@pevregistry/sdk
v2.0.1
Published
Node.js SDK for the PEV Registry partner API.
Readme
PEV Registry Node.js SDK
Lightweight Node.js client for the PEV Registry partner API.
Usage
const { PevRegistryClient } = require("./sdk/node");
const client = new PevRegistryClient({
apiKey: process.env.PEV_REGISTRY_API_KEY,
baseUrl: "https://pevregistry.com",
});
const result = await client.lookup("WT2500W26070581");
console.log(result);Methods
await client.lookup(identifier);
await client.reportPossession({ identifier });
await client.reportPossession({ registrationId });
await client.createServiceLog({
identifier,
serviceType: "Brake adjustment",
notes: "Adjusted rear brake caliper.",
odometerReading: 842,
servicedAt: "2026-09-22T14:30:00-04:00",
});
const { data, contentType } = await client.getPhotoByIndex(registrationId, 0);
// data is an ArrayBuffer; contentType is the real image content type (e.g. "image/jpeg")
// so you can forward it as-is through your own authorized proxy route.
//
// New devices are registered through the embeddable registration widget (see the "Registration
// Widget" section of /docs), not this SDK — there is no registerDevice() method.
await client.getAccount();
await client.updateAccount({ companyName: "Example Shop" });
await client.rotateApiKey();
await client.updateWebhook("https://example.com/webhooks/pev-registry");
await client.generateWebhookSecret();Errors throw PevRegistryError with status, response, and headers fields.
