npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@timesheet/integration-sdk

v0.4.0

Published

Type-safe contracts and helpers for Timesheet plugin integrations.

Downloads

433

Readme

@timesheet/integration-sdk

Type-only SDK and helper utilities for Timesheet sandboxed integration plugins.

The package ships TypeScript contracts (and a tiny defineHandler helper) that describe the manifest a plugin publishes and the runtime context a plugin receives. Plugins are executed in an isolated sandbox by the Timesheet plugin-runtime; this SDK is the typed contract between the two.

Install

npm install @timesheet/integration-sdk

While the SDK is on 0.x, a caret range pins the minor version: ^0.3.0 admits 0.3.x but not 0.4.0. Keep your plugin's declared range in sync with the SDK you build against.

What's inside

  • Manifest contractsIntegrationManifest plus TriggerDefinition (EventTrigger, WebhookTrigger, ScheduleTrigger, UserActionTrigger), ActionDefinition, PageDefinition, WidgetDefinition, MappingDefinition, ExternalAuthDefinition, and the JsonSchema used for config schemas. A trigger names the action to run via actionId, which the backend resolves to the matching actions[].handler.
  • Runtime contextIntegrationContext, exposing config, data (TimesheetDataClient), credentials, mappings, state, logger, and identifiers (userId, installationId, optional organizationId).
  • Event inputs — typed payloads for the events plugins handle (TaskCreatedInput, TaskUpdatedInput, WebhookInput, ScheduleInput, SyncModeInput, and the rest of the task/todo/project/expense/note/timer/user event family).
  • defineHandler — identity helper that infers the handler's input/output/config types.

Usage

A handler receives a typed input and the IntegrationContext:

import { defineHandler, TaskCreatedInput } from '@timesheet/integration-sdk';

export const syncTask = defineHandler<TaskCreatedInput>(async (input, context) => {
  const task = await context.data.getTask(input.taskId);
  context.logger.info('Syncing task', { taskId: task.id });
});

Reading and writing Timesheet data

context.data (TimesheetDataClient) wraps the scoped Timesheet API — list/get/create/ update/delete for projects, tasks, todos, expenses, notes, pauses, plus timer control and read access to teams, tags, colleagues, and settings:

import { defineHandler, SyncModeInput } from '@timesheet/integration-sdk';

export const fullSync = defineHandler<SyncModeInput>(async (_input, context) => {
  const projects = await context.data.listProjects({ limit: 100 });
  for (const project of projects.items) {
    context.logger.debug('project', { id: project.id, title: project.title });
  }
});

Credentials, mappings, and state

  • context.credentials — retrieve the connection credentials for the external service.
  • context.mappings — persist and look up MappingRecords linking Timesheet entities to external ones (e.g. a Timesheet project ↔ a Xero tracking category).
  • context.state — durable per-installation key/value storage for cursors, sync tokens, etc.
  • context.metadata.webhooks — map of triggerId → webhook URL when the manifest declares webhook triggers.

Development

npm run build       # compile to dist/ via tsc
npm run typecheck   # tsc --noEmit
npm test            # jest

Changelog

See CHANGELOG.md.