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/plugin-freshbooks

v1.0.0

Published

> Synchronize Timesheet tasks with FreshBooks time entries.

Readme

FreshBooks Sync

Synchronize Timesheet tasks with FreshBooks time entries.

Bidirectional synchronization between Timesheet tasks and FreshBooks time_entries. Timesheet projects map to FreshBooks projects and Timesheet users map to FreshBooks team members, so logged time lands on the right project and teammate in FreshBooks for billing.

  • Package: @timesheet/plugin-freshbooks
  • Manifest id: freshbooks-sync
  • Category: accounting

Authentication

OAuth 2.0 against FreshBooks. The access token is not scoped to a single business, so the plugin resolves the target business from GET /auth/api/v1/users/me:

  • business.id keys the Time Tracking, Projects, Services and Team Members endpoints.
  • business.account_id keys the Events (webhook callback) endpoints.

When the connected identity belongs to more than one business, set the businessId config option to pick one; otherwise the first membership is used.

Requested scopes: user:profile:read, user:time_entries:read, user:time_entries:write, user:projects:read, user:clients:read, user:billable_items:read, user:teams:read.

Configuration

| Option | Required | Default | Description | | --- | --- | --- | --- | | syncDirection | yes | bidirectional | One of bidirectional, timesheet-to-freshbooks, freshbooks-to-timesheet. | | businessId | no | (first) | FreshBooks business.id to sync when the account has multiple businesses. |

Mappings

  • Project mapping (required): Timesheet project to FreshBooks project. The FreshBooks project supplies the client the time entry is billed to.
  • User mapping (required): Timesheet user to FreshBooks team member (identity_id).
  • Rate mapping (optional): Timesheet rate to FreshBooks service (service_id).

Triggers

  • Task Changed (event): pushes Timesheet task create, update, and delete events to FreshBooks.
  • FreshBooks Webhook (webhook): receives inbound time_entry changes.
  • Scheduled Full Sync (daily at 02:00 UTC): reconciles task changes to FreshBooks.
  • Manual Sync (user action): pulls FreshBooks time entries updated since the last run.
  • Register Webhooks (user action): registers the FreshBooks callback for real-time inbound sync.

Webhook

FreshBooks callbacks are registered per account. Register Webhooks creates a single time_entry callback pointing at the plugin's webhook endpoint. FreshBooks then delivers a verification verifier to that endpoint; the handler stores it (it becomes the HMAC secret) and confirms the callback. Subsequent deliveries are authenticated with the X-FreshBooks-Hmac-SHA256 signature over the raw body. The Scheduled Full Sync and Manual Sync remain the reliable inbound path if callbacks are not registered.

Echo suppression

FreshBooks time entries expose no updated_at, only a created_at and an updated_since list filter. Outbound echoes are skipped with the SDK's isAlreadySyncedLocalChange guard; inbound echoes are detected by comparing the incoming entry's content to the local task (taskDiffersFromDesired) and re-stamping timesheetUpdatedAt after each inbound write.

Development

npm install        # or: npm ci
npm run build      # compile TypeScript into dist/
npm run typecheck

The package ships dist/ and manifest.json; the sandboxed plugin runtime loads it by package name, version, and integrity (sha512-...). Shared tests live in integrations/tests/ and run from the integrations/ root with npm test.