@usepatch/widget 0.1.0 → 0.2.1

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The embeddable feedback widget for [Patch](https://usepatch.dev). Drop it into your preview deployments and clients can pin comments directly on the page, no account required.
4
4
 
5
+ Works in any React app: Next.js, Vite, React Router, Astro, and more.
6
+
5
7
  ## Install
6
8
 
7
9
  ```sh
@@ -29,11 +31,26 @@ export default function RootLayout({ children }: { children: React.ReactNode })
29
31
  }
30
32
  ```
31
33
 
34
+ In Astro, render it as a client island in your layout:
35
+
36
+ ```astro
37
+ ---
38
+ import { Patch } from "@usepatch/widget";
39
+ ---
40
+ <html>
41
+ <body>
42
+ <slot />
43
+ <Patch client:only="react" />
44
+ </body>
45
+ </html>
46
+ ```
47
+
32
48
  The widget needs your project token, found in your Patch project settings. It resolves in this order:
33
49
 
34
50
  1. The `projectToken` prop: `<Patch projectToken="pk_..." />`
35
51
  2. `NEXT_PUBLIC_PATCH_TOKEN` (Next.js)
36
- 3. `VITE_PATCH_TOKEN` (Vite)
52
+ 3. `VITE_PATCH_TOKEN` (Vite / React Router)
53
+ 4. `PUBLIC_PATCH_TOKEN` (Astro)
37
54
 
38
55
  Project tokens are publishable keys, safe to expose in client-side code.
39
56