SDKs

TypeScript SDK

Install and use the Dime.Sheets TypeScript client library.

TypeScript SDK

The TypeScript SDK provides a typed client for the Dime.Sheets API, compatible with Node.js, Deno, Bun, and edge runtimes.

Installation

npm install @dimesheets/sdk

Quick start

import { DimeSheetsClient } from "@dimesheets/sdk";

const client = new DimeSheetsClient({
  apiKey: "your-api-key",
});

const projects = await client.projects.getAll();
for (const project of projects) {
  console.log(`${project.externalId}: ${project.name}`);
}

Configuration

OptionTypeDefaultDescription
apiKeystring--API key for authentication
baseUrlstringhttps://app.dimesheets.comAPI base URL

Resources

Projects

const all = await client.projects.getAll();
const one = await client.projects.getByExternalId("proj-100");
const created = await client.projects.create({ name: "New Project", externalId: "proj-101" });
const updated = await client.projects.update("proj-101", { name: "Updated Name" });
await client.projects.delete("proj-101");

Tasks

const tasks = await client.tasks.getAll();
const task = await client.tasks.getByExternalId("task-200");
const created = await client.tasks.create({ name: "Design", projectId: 3, externalId: "task-201" });
const updated = await client.tasks.update("task-201", { name: "Updated task" });
await client.tasks.delete("task-201");

Clients

const clients = await client.clients.getAll();
const one = await client.clients.getByExternalId("client-acme");

Time Entries

const entries = await client.timeEntries.getAll();
const filtered = await client.timeEntries.getAll({
  startDate: "2026-04-01",
  endDate: "2026-04-30",
});
const created = await client.timeEntries.create({
  taskId: 3,
  date: "2026-04-05T00:00:00Z",
  duration: 2.5,
  description: "API integration work",
  isBillable: true,
});

Timesheets

const timesheet = await client.timesheets.getById(12);

Reports

const report = await client.reports.get({ startDate: "2026-04-01", endDate: "2026-04-30" });
const utilization = await client.reports.getUtilization({ startDate: "2026-04-01", endDate: "2026-04-30" });
const budget = await client.reports.getBudget();

Timesheet Period Templates

const templates = await client.timesheetPeriodTemplates.getAll();
const template = await client.timesheetPeriodTemplates.getByExternalId("tpl-weekly");

Timesheet Periods

const periods = await client.timesheetPeriods.getAll();
const filtered = await client.timesheetPeriods.getFiltered({ year: 2026, status: 0 });
const period = await client.timesheetPeriods.getByExternalId("period-2026-w14");

Integration

const result = await client.integration.upsertProjects([
  { externalId: "erp-001", name: "ERP Project" },
]);
console.log(`Succeeded: ${result.succeeded}/${result.total}`);

Error handling

The SDK throws DimeSheetsError for non-2xx responses:

import { DimeSheetsError } from "@dimesheets/sdk";

try {
  await client.projects.getByExternalId("does-not-exist");
} catch (error) {
  if (error instanceof DimeSheetsError) {
    console.error(`${error.status}: ${error.message}`);
    console.error(error.body); // ProblemDetails object
  }
}