@cross-deck/web 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +35 -0
- package/dist/crossdeck.umd.min.js +2 -2
- package/dist/crossdeck.umd.min.js.map +1 -1
- package/dist/error-codes.json +1 -1
- package/dist/index.cjs +150 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.mjs +147 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +186 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +40 -2
- package/dist/react.d.ts +40 -2
- package/dist/react.mjs +184 -3
- package/dist/react.mjs.map +1 -1
- package/dist/trust-C0RcpR5I.d.mts +91 -0
- package/dist/trust-C0RcpR5I.d.ts +91 -0
- package/dist/vue.cjs +168 -3
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.mts +25 -1
- package/dist/vue.d.ts +25 -1
- package/dist/vue.mjs +166 -2
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@cross-deck/web` will be documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [1.13.0] — 2026-07-26
|
|
6
|
+
|
|
7
|
+
**Crossdeck Trust — the human-proof panel, native to the SDK.** Render the branded, un-restylable Trust panel (the same cross-origin `trust.cross-deck.com` iframe on every install) and mint a single-use attestation, handed back to you programmatically — no hidden field, no DOM.
|
|
8
|
+
|
|
9
|
+
- **React** (`@cross-deck/web/react`): `<CrossdeckTrust onToken={...} />` and the headless `useTrustToken()` hook.
|
|
10
|
+
- **Vue** (`@cross-deck/web/vue`): `useTrustToken()` composable.
|
|
11
|
+
- **Core**: `Crossdeck.trust.panel({ target, onToken })` (the publishable key comes from your `init()`), plus the framework-agnostic `mountTrustPanel()` for non-SDK use.
|
|
12
|
+
|
|
13
|
+
Pass the token to your server and verify it at the gate (`crossdeck.trust.gate({ email, ip, token })` in `@cross-deck/node`). **Bank-grade behaviour:** isolated (a stumble in the panel never throws into your app or breaks your signup form), origin-locked (only our panel window can deliver a token), and **fail-open, never fail-allow** — if the panel can't mint (adblocker, offline, our outage) you get `{ token: null }`, the signup proceeds, and the server scores the absent token. Failing *closed* would hand an attacker a site-wide-outage weapon, so we never do. The `<script src=".../embed.js">` loader remains the no-SDK / static-HTML path.
|
|
14
|
+
|
|
5
15
|
## [1.12.1] — 2026-07-24
|
|
6
16
|
|
|
7
17
|
**Republish of 1.12.0 — release-pipeline only, identical SDK.** 1.12.0 never reached npm: the release gate correctly failed it on the bundle budget, and by the time the budget fix landed the `v1.12.0` tag already existed on the public mirror, which refuses to overwrite a published artefact. Version bumped so the release can be cut cleanly. No SDK code changed — see 1.12.0 below for what actually shipped.
|
package/README.md
CHANGED
|
@@ -83,6 +83,41 @@ That's the full happy path.
|
|
|
83
83
|
- **Boot heartbeat.** On `init()` the SDK pings `/v1/sdk/heartbeat` so the dashboard's Apps page can show you "last seen" per install. Disable with `autoHeartbeat: false`.
|
|
84
84
|
- **Stripe-style errors.** Every async method throws `CrossdeckError` with `type`, `code`, `requestId`, and `status` — same shape as Stripe's SDKs, so generic error handlers transfer.
|
|
85
85
|
|
|
86
|
+
## Crossdeck Trust — human-proof at signup
|
|
87
|
+
|
|
88
|
+
Render the branded **Crossdeck Trust** panel and mint a single-use attestation that proves
|
|
89
|
+
a real browser loaded your page. It's a cross-origin iframe (un-restylable, identical on
|
|
90
|
+
every install); the SDK hands you the token programmatically — no hidden field, no DOM.
|
|
91
|
+
|
|
92
|
+
```jsx
|
|
93
|
+
// React — @cross-deck/web/react
|
|
94
|
+
import { CrossdeckTrust } from "@cross-deck/web/react";
|
|
95
|
+
|
|
96
|
+
<CrossdeckTrust onToken={(t) => setTrustToken(t.token)} />
|
|
97
|
+
// or headless: const { ref, token, status } = useTrustToken(); // <div ref={ref} />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<!-- Vue — @cross-deck/web/vue -->
|
|
102
|
+
<script setup>
|
|
103
|
+
import { useTrustToken } from "@cross-deck/web/vue";
|
|
104
|
+
const { el, token } = useTrustToken();
|
|
105
|
+
</script>
|
|
106
|
+
<template><div ref="el" /></template>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
// No framework:
|
|
111
|
+
const { ready } = Crossdeck.trust.panel({ target: "#cd-trust" });
|
|
112
|
+
const { token } = await ready; // { token, expiresAt } | { token: null }
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The publishable key comes from your `init()`. Send `token` to your server and verify it at
|
|
116
|
+
the gate (`crossdeck.trust.gate({ email, ip, token })` in `@cross-deck/node`). **Fail-open:**
|
|
117
|
+
if the panel can't mint (adblocker, offline, outage) you get `{ token: null }`, the signup
|
|
118
|
+
proceeds, and the server scores the absent token — it never throws and never blocks your
|
|
119
|
+
form.
|
|
120
|
+
|
|
86
121
|
## Auto-tracked events
|
|
87
122
|
|
|
88
123
|
| Event | When |
|