@sylergydigital/issue-pin-sdk 0.6.0 → 0.6.2
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/README.md +17 -10
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,10 +15,16 @@ npm install @sylergydigital/issue-pin-sdk
|
|
|
15
15
|
Ensure these are installed in your app:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install react react-dom @supabase/supabase-js html2canvas lucide-react
|
|
18
|
+
npm install react react-dom @supabase/supabase-js html2canvas-pro lucide-react
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
The public GitHub repo at `sylergydigital/issue-pin-sdk` is a read-only mirror
|
|
21
|
+
The public GitHub repo at `https://github.com/sylergydigital/issue-pin-sdk` is a read-only mirror of the publishable SDK package.
|
|
22
|
+
|
|
23
|
+
The package is published publicly on npm, so no `.npmrc` or GitHub Packages token setup is required for installation.
|
|
24
|
+
|
|
25
|
+
npm package page: `https://www.npmjs.com/package/@sylergydigital/issue-pin-sdk`
|
|
26
|
+
|
|
27
|
+
Source changes should still be made in the private source repo and will sync across automatically.
|
|
22
28
|
|
|
23
29
|
`react-router-dom` is **not** required. The SDK tracks `window.location` for thread fetching and `?highlight_thread=` without router context.
|
|
24
30
|
|
|
@@ -290,14 +296,15 @@ import { supabase } from "./lib/supabase";
|
|
|
290
296
|
<IssuePin apiKey="ew_live_..." supabaseClient={supabase} enabled={feedbackOn} />
|
|
291
297
|
```
|
|
292
298
|
|
|
293
|
-
No backend code
|
|
299
|
+
No backend code or sync secrets are needed in the host app. On the first successful federation call, Issue Pin verifies the external Supabase JWT against its issuer JWKS and bootstraps the workspace trust mapping automatically.
|
|
294
300
|
|
|
295
301
|
### How auto-federation works
|
|
296
302
|
|
|
297
303
|
When a user is detected via `supabaseClient`:
|
|
298
304
|
1. The SDK calls the `sdk-federate` endpoint with the API key + user identity
|
|
299
|
-
2. The endpoint validates the API key, resolves the workspace,
|
|
300
|
-
3.
|
|
305
|
+
2. The endpoint validates the API key, resolves the workspace, verifies the external Supabase JWT against the issuer JWKS, and derives the external project ref from the token issuer
|
|
306
|
+
3. If the workspace has no active Supabase issuer mapping yet, Issue Pin auto-creates the matching `identity_sources` and `workspace_identity_sources` records for that issuer
|
|
307
|
+
4. The endpoint upserts the user as a `client_federated` workspace member with `commenter` role
|
|
301
308
|
|
|
302
309
|
```mermaid
|
|
303
310
|
sequenceDiagram
|
|
@@ -311,6 +318,8 @@ sequenceDiagram
|
|
|
311
318
|
SDK->>EF: POST { apiKey, externalId, email, displayName }
|
|
312
319
|
EF->>DB: SHA-256(apiKey) → resolve_api_key()
|
|
313
320
|
DB-->>EF: workspace_id
|
|
321
|
+
EF->>DB: verify JWT via issuer JWKS
|
|
322
|
+
EF->>DB: bootstrap issuer mapping if missing
|
|
314
323
|
EF->>DB: Upsert user_identities
|
|
315
324
|
EF->>DB: Upsert workspace_members (commenter role)
|
|
316
325
|
DB-->>EF: OK
|
|
@@ -319,6 +328,8 @@ sequenceDiagram
|
|
|
319
328
|
Note over SDK: Result cached — runs once per session
|
|
320
329
|
```
|
|
321
330
|
|
|
331
|
+
The first verified Supabase issuer becomes the workspace's default SDK federation issuer. If you later need to trust a different or additional issuer, add it explicitly in the Federation UI.
|
|
332
|
+
|
|
322
333
|
### Other auth providers (manual)
|
|
323
334
|
|
|
324
335
|
For non-Supabase auth systems, pass identity props directly:
|
|
@@ -353,11 +364,7 @@ Paste this into **Claude Code**, **Cursor**, or **Codex** to integrate the SDK a
|
|
|
353
364
|
Add the Issue Pin feedback SDK to this React app.
|
|
354
365
|
|
|
355
366
|
Install: npm install @sylergydigital/issue-pin-sdk
|
|
356
|
-
Peer deps: npm install @supabase/supabase-js html2canvas lucide-react
|
|
357
|
-
|
|
358
|
-
.npmrc setup (required for GitHub Packages):
|
|
359
|
-
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
|
|
360
|
-
@sylergydigital:registry=https://npm.pkg.github.com
|
|
367
|
+
Peer deps: npm install react react-dom @supabase/supabase-js html2canvas-pro lucide-react
|
|
361
368
|
|
|
362
369
|
Integration:
|
|
363
370
|
1. Import { IssuePin } from "@sylergydigital/issue-pin-sdk"
|
package/dist/index.cjs
CHANGED
|
@@ -52,7 +52,7 @@ var import_react11 = require("react");
|
|
|
52
52
|
// src/FeedbackProvider.tsx
|
|
53
53
|
var import_react2 = require("react");
|
|
54
54
|
var import_supabase_js = require("@supabase/supabase-js");
|
|
55
|
-
var
|
|
55
|
+
var import_html2canvas_pro = __toESM(require("html2canvas-pro"), 1);
|
|
56
56
|
|
|
57
57
|
// src/useDocumentPathname.ts
|
|
58
58
|
var import_react = require("react");
|
|
@@ -680,7 +680,7 @@ function FeedbackProviderInner({
|
|
|
680
680
|
if (!client) return;
|
|
681
681
|
try {
|
|
682
682
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
683
|
-
const canvas = await (0,
|
|
683
|
+
const canvas = await (0, import_html2canvas_pro.default)(document.body, {
|
|
684
684
|
useCORS: true,
|
|
685
685
|
allowTaint: true,
|
|
686
686
|
logging: false,
|
|
@@ -712,7 +712,7 @@ function FeedbackProviderInner({
|
|
|
712
712
|
setMenuOpen(false);
|
|
713
713
|
setScreenshotCapturing(true);
|
|
714
714
|
try {
|
|
715
|
-
const canvas = await (0,
|
|
715
|
+
const canvas = await (0, import_html2canvas_pro.default)(document.body, {
|
|
716
716
|
useCORS: true,
|
|
717
717
|
scale: window.devicePixelRatio,
|
|
718
718
|
logging: false,
|