@renovel/sdk-node
v1.2.0
Published
Official Node.js SDK for the Renovel Platform
Readme
Renovel Node.js SDK
The official Node.js SDK for integrating with the Renovel platform. Fully written in TypeScript, supporting both ESM and CommonJS targets out of the box.
Installation
npm install @renovel/sdk-node
# or
pnpm add @renovel/sdk-node
# or
yarn add @renovel/sdk-nodeQuick Start
import { RenovelClient } from '@renovel/sdk-node';
const renovel = new RenovelClient({
apiKey: 'ren_live_your_api_key_goes_here',
});
const leads = await renovel.leads.list({ isUrgent: true, limit: 5 });
console.log('Urgent leads:', leads.page.length);Modules
Leads
const leads = await renovel.leads.list({ status: 'new', limit: 10 });
const lead = await renovel.leads.get('lead_id');
const newLead = await renovel.leads.create({ categoryId: 'cat_id', customerName: 'Johan' });
await renovel.leads.update('lead_id', { isUrgent: true });
await renovel.leads.setFollowUp('lead_id', new Date().toISOString());Bookings
const bookings = await renovel.bookings.list({ tab: 'pending' });
const result = await renovel.bookings.create({ name: 'Brf Tallbacken', email: '[email protected]', workAddress: 'Tallbacksvägen 12' });
await renovel.bookings.linkToLead({ bookingId: result.bookingId, leadId: 'lead_id' });Offers
const draft = await renovel.offers.generate({
customerName: 'Johan Andersson',
notes: 'Installation av laddbox',
isCompany: false,
isPrivatePerson: true,
isHouse: true,
isApartment: false,
isRot: false,
isGreenDeduction: false,
priceModel: 'Fast pris',
offerLevel: 'Mellan',
});
const revised = await renovel.offers.revise({
currentOfferText: draft.offerText,
revisionInstruction: 'Lägg till sektion om garanti',
});
await renovel.offers.send('lead_id', revised.offerText);Appointments
const apts = await renovel.appointments.list({ month: '2026-07' });
const apt = await renovel.appointments.get('apt_id');
await renovel.appointments.create({ title: 'Kundmöte', date: '2026-07-10', startTime: '10:00', endTime: '11:00', assignedUserId: 'user_id' });Inventory
const articles = await renovel.inventory.listArticles({ search: 'kabel' });Users
const me = await renovel.users.me();
const team = await renovel.users.list();Blogs
The blog endpoints are served by the Renovel dashboard's Next.js API at https://db.renovel.se/api/public/blog (configurable via baseUrl).
// List published posts (paginated, optional filters)
const list = await renovel.blogs.list({
lang: 'sv',
page: 1,
pageSize: 12,
category: 'Nyheter',
featured: true,
});
console.log(list.items, list.total);
// Get a single published post by slug
const post = await renovel.blogs.getBySlug('hej-varlden', 'sv'); // null if not found
// Get all categories
const categories = await renovel.blogs.getCategories('sv');Error Handling
import { RenovelClient, RenovelAuthenticationError, RenovelValidationError, RenovelRateLimitError } from '@renovel/sdk-node';
try {
await renovel.leads.create({ ... });
} catch (error) {
if (error instanceof RenovelAuthenticationError) {
console.error('Check your API Key');
} else if (error instanceof RenovelValidationError) {
console.error('Validation failed:', error.message);
} else if (error instanceof RenovelRateLimitError) {
console.error('Rate limit exceeded');
}
}Local Development
cd renovel-node-sdk
pnpm install
pnpm run build
pnpm link --globalIn your consuming project:
pnpm link --global @renovel/sdk-node