@ytspar/sweetlink 1.3.1 → 1.3.3

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.
Files changed (2) hide show
  1. package/README.md +18 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -76,7 +76,24 @@ That's it! The plugin automatically:
76
76
  - Detects Vite's port and configures everything
77
77
  - DevBar connects automatically
78
78
 
79
- ### For Any Node.js App (Express, Next.js, Remix, etc.)
79
+ ### For Next.js
80
+
81
+ Use the `instrumentation.ts` hook to start the server once on startup:
82
+
83
+ ```typescript
84
+ // src/instrumentation.ts (or instrumentation.ts at root)
85
+ export async function register() {
86
+ if (process.env.NEXT_RUNTIME === 'nodejs') {
87
+ if (process.env.NODE_ENV === 'development') {
88
+ import('@ytspar/sweetlink/auto');
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ This runs once when the Next.js server starts and auto-configures the WebSocket port based on the app port (3000 → 9223).
95
+
96
+ ### For Any Node.js App (Express, Remix, etc.)
80
97
 
81
98
  Add one line at the top of your server file:
82
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ytspar/sweetlink",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Autonomous development toolkit for AI agents - screenshots, DOM queries, console logs, and JavaScript execution via WebSocket and Chrome DevTools Protocol",
5
5
  "keywords": [
6
6
  "autonomous-development",