vendetusautos

← docs

SDK TypeScript

Cliente tipado que wrappea la REST API. Andar en Node, Bun, Deno, edge runtimes, y browsers modernos (todo lo que tenga fetch).

Instalar

npm install @vendetus/sdk

Uso

import { VendetusClient } from "@vendetus/sdk";

const client = new VendetusClient({
  apiKey: process.env.VENDETUS_API_KEY!,
});

// Listar autos activos
const { cars } = await client.listMyCars({ status: "active" });

// Bajar precio
const updated = await client.updateCar(cars[0].id, {
  price: 22000,
  currency: "USD",
});

// Analítica
const stats = await client.getAnalytics(cars[0].id, { days: 7 });
console.log(stats.totals.view, "vistas en 7 días");

Métodos

  • listMyCars(opts?) { cars: Car[] }
  • getCar(id) { car: CarWithPhotos }
  • updateCar(id, patch) { car: Car }
  • listOffers(carId) { offers: Offer[] }
  • listComments(carId) { comments: Comment[] }
  • getAnalytics(carId, opts?) AnalyticsResponse

Tipos completos exportados desde @vendetus/sdk: Car, CarWithPhotos, Offer, Comment, AnalyticsResponse, CarUpdate.