Scan your whole stack
From OX Research Newsroom
Are you using @wcstack/share?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v4.30.0
@wcstack/share was last scanned on 25 Nov 2026 at version 4.30.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 4.30.0 LATEST | 25 Nov 2026 | No rules fired |
| 4.29.0 | 24 Nov 2026 | No rules fired |
| 4.28.0 | 23 Nov 2026 | No rules fired |
| 4.27.0 | 23 Nov 2026 | Not shown |
| 4.26.0 | 18 Nov 2026 | Not shown |
Findings for v4.30.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 4.30.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
🤖 AI coding agents: This README is a package-level reference, not the primary entry point for building a wcstack application. If you have not already done so, first read the repository README and AGENTS.md, then use the wcstack-app skill.
@wcstack/share is a headless Web Share component for the wcstack ecosystem.
It is not a visual UI widget.
It is a command-only async primitive node that turns navigator.share(data) — click, native share sheet, resolve/reject — into a single declarative command, the same way @wcstack/notification turns Notification into reactive state plus a notify command.
With @wcstack/state, <wcs-share> can be bound directly through path contracts:
share(data) — a single async command, invoked as command.share: $command.doSharevalue, loading, error, cancelled, and — since 4.25 — supportedThis means a "Share this article" button can be expressed declaratively in HTML — success, failure, and the user simply dismissing the native share sheet are three distinct, bindable outcomes — without writing navigator.share() / try/catch glue in your UI layer.
@wcstack/share follows the wcstack Core/Shell architecture:
ShareCore) runs each navigator.share(data) call through the shared io-core operation lane (exhaust: one share sheet at a time, a call made while one is open is a no-op; dispose() invalidates a call in flight, so a late completion writes nothing), with same-value-guarded loading/error/cancelled setters (value is exempt — a completion signal that fires on every success) and a never-throw try/catch<wcs-share>) connects that command to DOM lifecycle and exposes canShare(data) as a plain synchronous methodstatic wcBindable) declares observable properties and a single share command (deliberately no inputs, no abort command)Every other wcstack IO node either monitors a continuous state (network, permission) or configures something ahead of time and observes it change (fetch's url, geolocation's enableHighAccuracy). navigator.share() is different: it is a one-shot "call → native share sheet → resolve/reject" action with no continuous state to configure or watch, and (unlike fetch) no way to abort an in-flight call — there is no AbortSignal option, and the platform allows only one modal share sheet at a time, so the "a new call supersedes the previous one" plumbing fetch needs has no counterpart here.
The other defining decision is separating cancelled from error. When a user simply closes the native share sheet, navigator.share() rejects with an AbortError — exactly like closing a <dialog>. Folding that into error would make a binding gated on error (e.g. showing a "sharing failed" banner only when it is set) also fire on routine, harmless user cancellation, which is a UX bug waiting to happen. <wcs-share> keeps cancelled as its own boolean/event, so error reflects only genuine platform failures (NotAllowedError, TypeError, etc.).
See
docs/web-share-tag-design.mdfor the full design rationale.
npm install @wcstack/share
<script type="module" src="https://esm.run/@wcstack/share/auto"></script>
<script type="module" src="https://esm.run/@wcstack/state/auto"></script>
<wcs-state>
<script type="module">
export default {
$commandTokens: ["doShare"],
loading: false,
error: null,
cancelled: false,
onShareClick() {
this.$command.doShare.emit({
title: document.title,
url: location.href,
});
},
};
</script>
</wcs-state>
<wcs-share
data-wcs="command.share: $command.doShare; loading: loading; error: error; cancelled: cancelled"
></wcs-share>
<button data-wcs="onclick: onShareClick; disabled: loading">Share</button>
<template data-wcs="if: error">
<p>Sharing failed: <span data-wcs="textContent: error.message"></span></p>
</template>
Because share() must run from within a real user gesture (a click handler), the button's click handler calls $command.doShare.emit(...) directly — <wcs-share> has no autoTrigger shortcut of its own (see Notes & limitations).
Since 4.25, the supported output says whether this page can use the Web Share API at all. Bind it and hide the button where it cannot:
<wcs-state>
<script type="module">
export default {
$commandTokens: ["doShare"],
shareSupported: false,
onShareClick() {
this.$command.doShare.emit({ title: document.title, url: location.href });
},
};
</script>
</wcs-state>
<wcs-share data-wcs="command.share: $command.doShare; supported: shareSupported"></wcs-share>
<button data-wcs="hidden: shareSupported|not; onclick: onShareClick">Share</button>
canShare(data) — asking about this datasupported is about the page. Whether a particular payload can be shared — files above all — is still a question for canShare(data):
<script type="module">
const shareEl = document.querySelector("wcs-share");
// photo: a File the page holds (from an <input type="file">, a canvas, ...)
if (shareEl.canShare({ files: [photo] })) {
// offer "Share the photo"
}
</script>
| Property | Event | Description |
|---|---|---|
value |
wcs-share:complete |
An echo of the data object passed to the share() call that just completed successfully, signalling "this share succeeded" (navigator.share() itself resolves Promise<void> with no payload). null before any successful share. |
loading |
wcs-share:loading-changed |
true while a share() call is in flight. |
error |
wcs-share:error |
A genuine platform failure (anything other than the user cancelling the share sheet). null when there has been no failure yet, or after the next share() call resets it. |
cancelled |
wcs-share:cancelled-changed |
true when the user dismissed the native share sheet (AbortError). Kept independent of error so bindings gated on error do not react to routine cancellation. |
errorInfo |
wcs-share:error-info-changed |
Serializable failure taxonomy (stable code / phase / recoverable), or null. Additive — the error shape is unchanged; code is capability-missing when unsupported or share-failed on a genuine failure. |
supported |
wcs-share:supported-changed |
Since 4.25. true when this page can use the Web Share API. See below. |
supported (since 4.25) is true when navigator.share is a function and the page is not forbidden to use it: a Permissions-Policy that turns web-share off (the server's header, or an <iframe> without allow="web-share") and an insecure context both make it false. (A browser whose policy does not know the web-share feature — desktop Chromium — is not asked about it: there the API's presence decides.) It is read from the browser each time it is asked for, so a binding gets the right value when it attaches; the element also dispatches wcs-share:supported-changed (the boolean as detail) when it is connected, if the value differs from the last one it dispatched (it starts at false).
It does not say that a particular payload can be shared — canShare(data) stays the way to ask about this data (files) — and it does not say the user will pick a target. Where a Permissions-Policy is the reason, share() is still passed to the browser, which rejects it (error, errorInfo.code: "share-failed"); where navigator.share is missing, share() ends as capability-missing without calling anything.
Concurrency. A share sheet is a single system-modal surface, so <wcs-share>
runs its calls through the shared io-core lane with the exhaust policy: while one
share() is in flight, a second call is an idempotent no-op (it returns null
without opening a second sheet), leaving the in-flight call's result untouched.
cancelled and error are both reset (false / null) at the start of a share() call that goes on to actually invoke navigator.share(), so a stale outcome from a previous call never lingers into that call's result. The one exception is the unsupported early-return (navigator.share missing, see below): it returns before that reset runs, so a cancelled left over from an earlier call can still read true alongside the freshly-set unsupported error. This is a narrow edge case in practice — a page losing navigator.share mid-session is not a realistic scenario.
| Command | Async | Description |
|---|---|---|
share |
yes | Invokes navigator.share(data) with a single options object ({ title?, text?, url?, files? }) passed as one positional argument. |
There is no abort command — the Web Share API offers no mechanism to cancel an in-flight share() call from the caller's side.
Wire
sharethrough a state method, not straight to a button.<button data-wcs="onclick: $command.doShare">emits the token with the DOM event as its first argument, so the element is called asshare(event)— and the browser rejects anEventas share data with aTypeError(error,share-failed). The command takes data: emit it from a method, asonShareClick()does in the Quick Start (this.$command.doShare.emit({ url })).
canShare(data) — a plain synchronous method, not part of wcBindablenavigator.canShare(data) is a synchronous, side-effect-free predicate. It does not fit the wc-bindable properties shape (an observable with no arguments) or the commands shape (fire-and-observe-via-event); it is exposed directly as a plain instance method:
const canShare: boolean = shareEl.canShare({ url: "https://example.com" });
It returns false (rather than throwing) when navigator.canShare is absent.
None. share(data)'s data varies on every call — it is a command argument, not a value to park on the element ahead of time as an attribute.
:state()<wcs-share> reflects three boolean output states onto its
ElementInternals CustomStateSet,
so you can style it directly from CSS with the :state() pseudo-class — no
data-wcs binding or extra class toggling required.
| State | On when |
|---|---|
loading |
wcs-share:loading-changed fires with true (cleared on false) |
cancelled |
wcs-share:cancelled-changed fires with true (cleared on false) |
error |
wcs-share:error fires with a non-null detail (cleared on null) |
wcs-share:state(loading) ~ .spinner { display: block; }
wcs-share:state(loading) ~ .spinner { display: none; } /* default */
wcs-share:state(cancelled) ~ .hint { display: block; }
form:has(wcs-share:state(error)) .banner { display: block; }
Unlike attributes or classes, :state() cannot be written from outside the
element, so there is no risk of confusing this output state with an input.
Browser support (:state(x) syntax): Chrome/Edge 125+, Safari 17.4+,
Firefox 126+. In older browsers the states are simply never set — :state()
selectors never match, but <wcs-share> itself keeps working normally
(graceful degradation, never-throw).
SSR: :state() cannot be serialized into HTML, so server-rendered markup
never carries these states on first paint (@wcstack/server is unaffected).
If you need to style the pre-hydration gap, pair your rule with
wcs-share:not(:defined) instead.
Custom states are invisible in DevTools' Elements panel and attachInternals()
cannot be called twice, so there is no console way to inspect them directly.
Two debug-only aids are provided for that:
el.debugStates — a snapshot array of the currently-on state names
(e.g. ["loading"]). It is not part of wc-bindable (not a bind target)
and its shape is not a guaranteed contract — use it for debugging only.
The debug-states attribute (opt-in, default off) mirrors state changes
onto data-wcs-state-loading / data-wcs-state-cancelled /
data-wcs-state-error attributes on the element, so the Elements panel
highlights them as they toggle:
<wcs-share debug-states></wcs-share>
*Write your CSS against :state(), not `data-wcs-state-`.** The mirrored
attributes exist purely to make state changes visible while debugging with
DevTools open; they are not a supported styling hook.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.