Skip to main content
browser-common

Small, tree-shakeable TypeScript wrappers around 40+ browser Web APIs.

import {
isClipboardApiAvailable,
copyToClipboard,
} from '@rtorcato/browser-common/clipboard'

if (isClipboardApiAvailable()) {
await copyToClipboard('hello world')
}
npm install @rtorcato/browser-common

Use with AI

A skill ships with the package so coding agents use browser-common correctly — whichever tool you're in.

Claude Code

Register the marketplace once, then install the plugin:

/plugin marketplace add rtorcato/browser-common
/plugin install browser-common@browser-common
Cursor, Copilot, Codex & others

They read the bundled AGENTS.md from node_modules — or paste these rules into your agent config.

- Import from the subpath: @rtorcato/browser-common/<module> — never the package root.
- Feature-guard before use: call is<Name>Available() first; wrappers no-op
(return null/false) on unsupported runtimes instead of throwing.
- clipboard, geolocation, mediadevices, notifications, serviceworkers need
HTTPS (or localhost) plus a permission grant.
- SSR / Node safe: imports are side-effect-free; calls no-op without window.
View AGENTS.md →
Tiny per-module imports
Tiny per-module imports
146–257 B brotlied per subpath. Tree-shake to just the bytes you use.
Safe by default
Safe by default
Every module exports `is<Name>Available()`. Operations never throw on unsupported runtimes.
TypeScript-first
TypeScript-first
Strict types, generics preserved, JSDoc-rich in your IDE. Zero runtime dependencies.
44 Web APIs covered
44 Web APIs covered
One subpath per spec — clipboard, geolocation, storage, observers, and 40 more.

One subpath per Web API

Eight focused categories. 44 modules. Import exactly what you need.

View all modules →

Sibling projects

More from @rtorcato — same conventions, same release pipeline.