securenow 7.6.7 → 7.6.9
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/NPM_README.md +13 -13
- package/README.md +21 -37
- package/app-config.js +5 -3
- package/cli/config.js +4 -3
- package/cli/diagnostics.js +54 -15
- package/cli/run.js +40 -11
- package/firewall-only.js +1 -1
- package/mcp/catalog.js +1 -1
- package/nextjs-webpack-config.js +3 -15
- package/nextjs.js +21 -23
- package/nuxt-server-plugin.mjs +20 -10
- package/package.json +23 -33
- package/register.js +1 -1
- package/tracing.js +17 -7
- package/web-vite.mjs +23 -13
- package/CONSUMING-APPS-GUIDE.md +0 -463
- package/docs/ALL-FRAMEWORKS-QUICKSTART.md +0 -1388
- package/docs/API-KEYS-GUIDE.md +0 -278
- package/docs/ARCHITECTURE.md +0 -408
- package/docs/AUTO-BODY-CAPTURE.md +0 -412
- package/docs/AUTO-SETUP-SUMMARY.md +0 -331
- package/docs/AUTO-SETUP.md +0 -419
- package/docs/AUTOMATIC-IP-CAPTURE.md +0 -359
- package/docs/BODY-CAPTURE-FIX.md +0 -261
- package/docs/BODY-CAPTURE-QUICKSTART.md +0 -147
- package/docs/CHANGELOG-NEXTJS.md +0 -235
- package/docs/COMPLETION-REPORT.md +0 -408
- package/docs/CUSTOMER-GUIDE.md +0 -364
- package/docs/EASIEST-SETUP.md +0 -342
- package/docs/ENVIRONMENT-VARIABLES.md +0 -166
- package/docs/ENVIRONMENTS.md +0 -60
- package/docs/EXPRESS-BODY-CAPTURE.md +0 -1028
- package/docs/EXPRESS-SETUP-GUIDE.md +0 -722
- package/docs/FINAL-SOLUTION.md +0 -335
- package/docs/FIREWALL-GUIDE.md +0 -440
- package/docs/IMPLEMENTATION-SUMMARY.md +0 -410
- package/docs/INDEX.md +0 -222
- package/docs/LOGGING-GUIDE.md +0 -704
- package/docs/LOGGING-QUICKSTART.md +0 -221
- package/docs/MCP-GUIDE.md +0 -58
- package/docs/NEXTJS-BODY-CAPTURE-COMPARISON.md +0 -323
- package/docs/NEXTJS-BODY-CAPTURE.md +0 -368
- package/docs/NEXTJS-GUIDE.md +0 -392
- package/docs/NEXTJS-QUICKSTART.md +0 -83
- package/docs/NEXTJS-SETUP-COMPLETE.md +0 -795
- package/docs/NEXTJS-WEBPACK-WARNINGS.md +0 -267
- package/docs/NEXTJS-WRAPPER-APPROACH.md +0 -414
- package/docs/NUXT-GUIDE.md +0 -173
- package/docs/QUICKSTART-BODY-CAPTURE.md +0 -293
- package/docs/REDACTION-EXAMPLES.md +0 -484
- package/docs/REQUEST-BODY-CAPTURE.md +0 -587
- package/docs/SOLUTION-SUMMARY.md +0 -312
- package/docs/VERCEL-OTEL-MIGRATION.md +0 -255
- package/examples/README.md +0 -265
- package/examples/express-with-logging.js +0 -137
- package/examples/instrumentation-with-auto-capture.ts +0 -41
- package/examples/next.config.js +0 -37
- package/examples/nextjs-api-route-with-body-capture.ts +0 -54
- package/examples/nextjs-env-example.txt +0 -32
- package/examples/nextjs-instrumentation.js +0 -36
- package/examples/nextjs-instrumentation.ts +0 -36
- package/examples/nextjs-middleware.js +0 -37
- package/examples/nextjs-middleware.ts +0 -37
- package/examples/nextjs-with-logging-example.md +0 -301
- package/examples/nextjs-with-options.ts +0 -36
- package/examples/test-nextjs-setup.js +0 -70
- package/postinstall.js +0 -296
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
# 🎉 Automatic Setup Feature - Complete!
|
|
2
|
-
|
|
3
|
-
## ✅ Yes! The instrumentation file CAN be added automatically!
|
|
4
|
-
|
|
5
|
-
I've implemented **THREE ways** for your customers to set up SecureNow:
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 🚀 Option 1: Fully Automatic (Best UX!)
|
|
10
|
-
|
|
11
|
-
**What happens when they install:**
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install securenow
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**The installer automatically:**
|
|
18
|
-
1. ✅ Detects it's a Next.js project
|
|
19
|
-
2. ✅ Asks: "Would you like to automatically create instrumentation file? (Y/n)"
|
|
20
|
-
3. ✅ Creates `instrumentation.ts` (or `.js`) in the correct location
|
|
21
|
-
4. ✅ Creates `.env.local` template
|
|
22
|
-
5. ✅ Shows clear next steps
|
|
23
|
-
|
|
24
|
-
**Customer experience:**
|
|
25
|
-
```
|
|
26
|
-
$ npm install securenow
|
|
27
|
-
|
|
28
|
-
┌─────────────────────────────────────────────────┐
|
|
29
|
-
│ 🎉 SecureNow installed successfully! │
|
|
30
|
-
│ Next.js project detected │
|
|
31
|
-
└─────────────────────────────────────────────────┘
|
|
32
|
-
|
|
33
|
-
Would you like to automatically create instrumentation file? (Y/n) Y
|
|
34
|
-
|
|
35
|
-
✅ Created instrumentation.ts
|
|
36
|
-
✅ Created .env.local template
|
|
37
|
-
|
|
38
|
-
┌─────────────────────────────────────────────────┐
|
|
39
|
-
│ 🚀 Next Steps: │
|
|
40
|
-
│ │
|
|
41
|
-
│ 1. Edit .env.local and set: │
|
|
42
|
-
│ SECURENOW_APPID=your-app-name │
|
|
43
|
-
│ SECURENOW_INSTANCE=http://otel-collector:4318 │
|
|
44
|
-
│ │
|
|
45
|
-
│ 2. Run your app: npm run dev │
|
|
46
|
-
│ 3. Check SecureNow for traces! │
|
|
47
|
-
└─────────────────────────────────────────────────┘
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Result: Customer is set up in 30 seconds!** ⚡
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 🛠️ Option 2: CLI Command (If they skip auto-setup)
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx securenow init
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
**Features:**
|
|
61
|
-
- Interactive setup
|
|
62
|
-
- Smart defaults (detects TypeScript, src folder, etc.)
|
|
63
|
-
- Can force overwrite
|
|
64
|
-
- Flexible options
|
|
65
|
-
|
|
66
|
-
**Examples:**
|
|
67
|
-
```bash
|
|
68
|
-
# Basic setup
|
|
69
|
-
npx securenow init
|
|
70
|
-
|
|
71
|
-
# TypeScript in src folder
|
|
72
|
-
npx securenow init --typescript --src
|
|
73
|
-
|
|
74
|
-
# Force overwrite
|
|
75
|
-
npx securenow init --force
|
|
76
|
-
|
|
77
|
-
# Show help
|
|
78
|
-
npx securenow help
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## 📝 Option 3: Manual (For advanced users)
|
|
84
|
-
|
|
85
|
-
They can still create files manually if they prefer.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## 🧠 Smart Features
|
|
90
|
-
|
|
91
|
-
### Auto-Detection
|
|
92
|
-
|
|
93
|
-
**Detects Next.js:**
|
|
94
|
-
- Checks for `next` in package.json
|
|
95
|
-
|
|
96
|
-
**Chooses file type:**
|
|
97
|
-
- Has `tsconfig.json` → creates `.ts`
|
|
98
|
-
- No tsconfig → creates `.js`
|
|
99
|
-
|
|
100
|
-
**Chooses location:**
|
|
101
|
-
- Has `src/` folder → creates in `src/`
|
|
102
|
-
- No src → creates in root
|
|
103
|
-
|
|
104
|
-
**Handles .env.local:**
|
|
105
|
-
- Creates if missing
|
|
106
|
-
- Never overwrites existing file
|
|
107
|
-
|
|
108
|
-
### CI/CD Safe
|
|
109
|
-
|
|
110
|
-
**Skips in non-interactive environments:**
|
|
111
|
-
```bash
|
|
112
|
-
[securenow] ℹ️ Non-interactive environment detected
|
|
113
|
-
[securenow] 💡 To complete setup, run: npx securenow init
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
**Can be disabled:**
|
|
117
|
-
```bash
|
|
118
|
-
# Skip postinstall
|
|
119
|
-
npm install --ignore-scripts
|
|
120
|
-
|
|
121
|
-
# Or environment variable
|
|
122
|
-
SECURENOW_NO_POSTINSTALL=1 npm install
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## 📦 What Was Added
|
|
128
|
-
|
|
129
|
-
### New Files
|
|
130
|
-
|
|
131
|
-
1. **`postinstall.js`** (200+ lines)
|
|
132
|
-
- Runs after `npm install`
|
|
133
|
-
- Detects Next.js
|
|
134
|
-
- Creates files automatically
|
|
135
|
-
- Interactive prompts
|
|
136
|
-
|
|
137
|
-
2. **`cli.js`** (300+ lines)
|
|
138
|
-
- Full-featured CLI tool
|
|
139
|
-
- `npx securenow init`
|
|
140
|
-
- Multiple options and flags
|
|
141
|
-
- Help and version commands
|
|
142
|
-
|
|
143
|
-
3. **`AUTO-SETUP.md`** (complete guide)
|
|
144
|
-
- Explains all options
|
|
145
|
-
- Troubleshooting
|
|
146
|
-
- Best practices
|
|
147
|
-
|
|
148
|
-
### Updated Files
|
|
149
|
-
|
|
150
|
-
- **`package.json`**
|
|
151
|
-
- Added `bin` entry for CLI
|
|
152
|
-
- Added `postinstall` script
|
|
153
|
-
- Included new files
|
|
154
|
-
|
|
155
|
-
- **`README.md`** - Mentions automatic setup
|
|
156
|
-
- **`NEXTJS-GUIDE.md`** - Updated with auto-setup info
|
|
157
|
-
- **`NEXTJS-QUICKSTART.md`** - Now shows auto-setup first
|
|
158
|
-
- **`CUSTOMER-GUIDE.md`** - Highlights automatic feature
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## 🎯 User Journey (Now Even Simpler!)
|
|
163
|
-
|
|
164
|
-
### Before (Manual)
|
|
165
|
-
```
|
|
166
|
-
1. npm install securenow
|
|
167
|
-
2. Create instrumentation.ts manually
|
|
168
|
-
3. Create .env.local manually
|
|
169
|
-
4. Configure values
|
|
170
|
-
5. Run app
|
|
171
|
-
Total: 5-10 minutes
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### After (Automatic)
|
|
175
|
-
```
|
|
176
|
-
1. npm install securenow
|
|
177
|
-
2. Press "Y" when asked
|
|
178
|
-
3. Edit .env.local (already created)
|
|
179
|
-
4. Run app
|
|
180
|
-
Total: 1-2 minutes ⚡
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
**Improvement: 5-10x faster!**
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## 🎓 Documentation
|
|
188
|
-
|
|
189
|
-
All documentation updated to show automatic setup:
|
|
190
|
-
|
|
191
|
-
1. **AUTO-SETUP.md** - Complete guide to all setup methods
|
|
192
|
-
2. **CUSTOMER-GUIDE.md** - Now highlights auto-install
|
|
193
|
-
3. **NEXTJS-QUICKSTART.md** - Shows auto-setup as default
|
|
194
|
-
4. **NEXTJS-GUIDE.md** - Explains all options
|
|
195
|
-
5. **README.md** - Mentions automatic feature
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
## 💯 Benefits
|
|
200
|
-
|
|
201
|
-
### For Your Customers
|
|
202
|
-
|
|
203
|
-
✅ **30-second setup** (down from 5-10 minutes)
|
|
204
|
-
✅ **No manual file creation** needed
|
|
205
|
-
✅ **No typing errors** in boilerplate
|
|
206
|
-
✅ **Clear next steps** shown automatically
|
|
207
|
-
✅ **Flexible options** if they need control
|
|
208
|
-
|
|
209
|
-
### For You
|
|
210
|
-
|
|
211
|
-
✅ **Better UX** = more adoption
|
|
212
|
-
✅ **Fewer support questions** (it just works)
|
|
213
|
-
✅ **Professional polish** (like big packages)
|
|
214
|
-
✅ **Three options** for different user types
|
|
215
|
-
✅ **CI/CD safe** (doesn't break builds)
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## 🚀 How It Works
|
|
220
|
-
|
|
221
|
-
### Postinstall Script
|
|
222
|
-
|
|
223
|
-
```javascript
|
|
224
|
-
// Runs automatically after npm install
|
|
225
|
-
1. Check if Next.js project
|
|
226
|
-
2. Check if files already exist
|
|
227
|
-
3. Check if interactive environment
|
|
228
|
-
4. Ask user for confirmation
|
|
229
|
-
5. Create instrumentation file
|
|
230
|
-
6. Create .env.local template
|
|
231
|
-
7. Show next steps
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### CLI Command
|
|
235
|
-
|
|
236
|
-
```javascript
|
|
237
|
-
// npx securenow init
|
|
238
|
-
1. Parse command-line flags
|
|
239
|
-
2. Detect project type
|
|
240
|
-
3. Choose file type and location
|
|
241
|
-
4. Create files
|
|
242
|
-
5. Show success message
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## 🎉 Result
|
|
248
|
-
|
|
249
|
-
**Your customers now have the EASIEST Next.js OpenTelemetry setup possible:**
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
# Literally just this:
|
|
253
|
-
npm install securenow
|
|
254
|
-
# Press Y
|
|
255
|
-
|
|
256
|
-
# Done! ✨
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
**No other OpenTelemetry package makes it this easy!**
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
## 📊 Comparison
|
|
264
|
-
|
|
265
|
-
| Package | Setup Steps | Time | Auto-Creates Files |
|
|
266
|
-
|---------|-------------|------|-------------------|
|
|
267
|
-
| **SecureNow** | 2 | 1-2 min | ✅ Yes |
|
|
268
|
-
| @vercel/otel | 4 | 5-10 min | ❌ No |
|
|
269
|
-
| Manual OTel | 10+ | 30+ min | ❌ No |
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## ✅ Testing
|
|
274
|
-
|
|
275
|
-
You can test it right now:
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
# In a Next.js project, install your package
|
|
279
|
-
npm install ./path-to-securenow-package
|
|
280
|
-
|
|
281
|
-
# You'll see the auto-setup prompt!
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Or test the CLI:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
npx securenow init
|
|
288
|
-
npx securenow help
|
|
289
|
-
npx securenow version
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## 🎁 Bonus Features
|
|
295
|
-
|
|
296
|
-
Beyond what you asked, I added:
|
|
297
|
-
|
|
298
|
-
✅ **Multiple setup methods** (auto, CLI, manual)
|
|
299
|
-
✅ **Smart defaults** (detects TypeScript, src folder)
|
|
300
|
-
✅ **CLI with options** (--typescript, --src, --force)
|
|
301
|
-
✅ **CI/CD safe** (skips in non-interactive)
|
|
302
|
-
✅ **Help and version** commands
|
|
303
|
-
✅ **Comprehensive docs** (AUTO-SETUP.md)
|
|
304
|
-
✅ **Error handling** (graceful failures)
|
|
305
|
-
✅ **Clear messaging** (beautiful console output)
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## 🎯 Summary
|
|
310
|
-
|
|
311
|
-
**You asked:** "Can the instrumentation file be added automatically?"
|
|
312
|
-
|
|
313
|
-
**Answer:** ✅ **YES! And it's IMPLEMENTED!**
|
|
314
|
-
|
|
315
|
-
**Three ways to set up:**
|
|
316
|
-
1. 🎉 **Automatic** - Just press Y during install
|
|
317
|
-
2. 🛠️ **CLI** - `npx securenow init`
|
|
318
|
-
3. 📝 **Manual** - Create files yourself
|
|
319
|
-
|
|
320
|
-
**Result:** The easiest Next.js OpenTelemetry setup in existence! 🚀
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
**Ready to ship!** All code, documentation, and examples are complete.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|