Skip to content

v1.2.0

Latest

Choose a tag to compare

@MindInitiatives MindInitiatives released this 22 May 10:29
· 1 commit to main since this release

Release Notes: Clipify v1.2.0

Overview

This release makes Clipify safer to run anywhere and smarter about managing
clipboard history — without breaking any existing code. Everything from v1.1.x
continues to work exactly as before. v1.2.0 adds history search, item pinning,
and tagging, makes the library safe to import in Node and server-side rendering
(SSR) environments, and fixes two cases where the code and documentation
disagreed.


New Features

1. Search History

  • Find clipboard items by text, key, or tag — case-insensitive, most-recent-first.
  • New Method: search.
    Example:
  const results = clipboard.search("invoice");

2. Pin Items

  • Pin an item to protect it from expiry, so a TTL won't remove something you
    want to keep.
  • New Methods: pin and unpin.
    Example:
  clipboard.pin("greeting");
  clipboard.unpin("greeting");

3. Tag Items

  • Attach freeform tags to items and retrieve them by tag. Tags are de-duplicated.
  • New Methods: tag and getByTag.
    Example:
  clipboard.tag("greeting", "work", "important");
  const workItems = clipboard.getByTag("work");

4. SSR / Node Safety

  • Clipify can now be imported and used on the server without crashing.
  • Where there is no system clipboard, copy records to history only, paste
    returns the most recent history item, and isClipboardSupported() returns
    false instead of throwing — so the same code runs on server and client.

Improvements

  • Type Exports:
    • The package now exports its public types (ClipboardItem,
      ClipboardOptions, ClipboardEventListener) for consumers.
  • History Item Shape:
    • ClipboardItem now optionally carries pinned and tags fields.
  • Process Hygiene:
    • Expiry timers are now unref'd so they don't keep a Node process alive.
  • Documentation:
    • README updated with the new search, pin, and tag APIs and SSR notes.

Bug Fixes

  • copyFile expiry: copyFile now accepts the optional expiryTime
    argument that the README already documented (copyFile(blob, key, 10000)).
    Existing two-argument calls are unaffected.
  • Resilient copy: copy no longer throws when a system-clipboard write
    fails (e.g. permission or focus errors); the item is still recorded in
    history and the copy event still fires.
  • No more crashes without navigator: previously copy, paste, and
    isClipboardSupported could throw in environments lacking
    navigator.clipboard; these now degrade gracefully.

Breaking Changes

  • None. This is a fully backward-compatible release. All v1.1.x code
    continues to work without modification.

Notes & What's Next

  • clearHistory() is unchanged from v1.1.x: it clears the entire history,
    including pinned items. Pinning currently protects against expiry, not
    against an explicit clearHistory() call.
  • The next major release (v2.0.0) will introduce "real pins" —
    clearHistory() will preserve pinned items by default, with an explicit
    override to wipe them — alongside other deliberate, documented API changes.

How to Upgrade

  1. Update your package via NPM or Yarn:
   npm update clipify
  1. No code changes are required. Explore the new search, pin, and tag
    methods in the documentation.

Feedback

We appreciate your feedback! Please report issues or suggest features via our
GitHub Issues.
Thank you for using Clipify! 🎉