---
name: bijection-debouncer
description: "Evaluate and integrate the Debouncer component with Bijection."
---

# Debouncer

Debounced background processing

- Package: @bijectionhq/debouncer
- Category: Durable Functions
- Status: Preview
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/debouncer/tree/3204fcdc8729984dfe82e20ac0ce5a4a1687ad0b
- Upstream: https://github.com/ikhrustalev/convex-debouncer/tree/9dc4c2ec2b9b9da98563926e9066437aa31c4c5f
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/debouncer

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/debouncer.git
cd debouncer
git checkout 3204fcdc8729984dfe82e20ac0ce5a4a1687ad0b
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @ikhrustalev/convex-debouncer. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


# Convex Debouncer

## Instructions

A server-side debouncing component that prevents expensive operations from running too frequently by waiting for periods of inactivity. It provides three debouncing modes (sliding, fixed, eager) to handle different scenarios like LLM calls, metrics computation, or batch processing. The component schedules functions to run after configurable delays and automatically manages cancellation and rescheduling based on incoming triggers.

### Installation

```bash
npm install @ikhrustalev/convex-debouncer
```

## Use cases

• **Debounce AI/LLM responses** when users are rapidly typing messages to avoid wasted API calls while ensuring the final message gets processed
• **Throttle expensive recomputation** like analytics, metrics, or search indexing when data changes frequently but you only need the final state
• **Batch process rate-limited APIs** by collecting multiple updates and processing them together at fixed intervals
• **Implement auto-save functionality** that waits for typing pauses before persisting data to avoid excessive database writes
• **Optimize real-time collaboration features** by providing immediate feedback while ensuring eventual consistency with a trailing execution

## How it works

The component uses Convex's scheduled functions infrastructure to manage debounced execution. You create a `Debouncer` instance with your desired delay and mode, then call `schedule()` with a namespace, key, target function, and arguments. The component tracks pending executions and automatically handles cancellation and rescheduling based on the selected mode.

Three modes handle different scenarios: sliding mode resets the timer on each call (ideal for search-as-you-type), fixed mode maintains the original timer while updating arguments (perfect for batch processing), and eager mode executes immediately then queues a trailing call (great for real-time feedback with eventual consistency).

The API provides `schedule()` for triggering debounced calls, `status()` for checking pending executions, and `cancel()` for manual cancellation. Each debounced call is uniquely identified by a namespace/key pair, allowing you to manage multiple independent debouncing contexts within the same application.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Convex Debouncer is not needed

## Resources

- [npm package](https://www.npmjs.com/package/%40ikhrustalev%2Fconvex-debouncer)
- [GitHub repository](https://github.com/ikhrustalev/convex-debouncer)
- [Convex Components Directory](https://www.convex.dev/components/ikhrustalev/convex-debouncer)
- [Convex documentation](https://docs.convex.dev)