securenow 5.12.2 → 5.15.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.
@@ -175,37 +175,37 @@ SECURENOW_LOGGING_ENABLED=1 SECURENOW_APPID=express-app node app.js
175
175
 
176
176
  ### Next.js (App Router)
177
177
 
178
- **1. Create `instrumentation.ts` in project root:**
178
+ **1. Run `npx securenow init`** or create `instrumentation.ts` in your project root:
179
179
 
180
180
  ```typescript
181
181
  // instrumentation.ts
182
182
  export async function register() {
183
183
  if (process.env.NEXT_RUNTIME === 'nodejs') {
184
- process.env.SECURENOW_LOGGING_ENABLED = '1';
185
- await import('securenow/register');
184
+ const { registerSecureNow } = require('securenow/nextjs');
185
+ registerSecureNow();
186
186
  }
187
187
  }
188
188
  ```
189
189
 
190
- **2. Enable in `next.config.js`:**
190
+ **2. Update `next.config.js` with `withSecureNow()`:**
191
191
 
192
192
  ```javascript
193
- /** @type {import('next').NextConfig} */
194
- const nextConfig = {
195
- experimental: {
196
- instrumentationHook: true,
197
- },
198
- };
193
+ const { withSecureNow } = require('securenow/nextjs-webpack-config');
199
194
 
200
- module.exports = nextConfig;
195
+ module.exports = withSecureNow({
196
+ // your existing config
197
+ });
201
198
  ```
202
199
 
200
+ This auto-detects Next.js 14 vs 15 and sets the correct `serverExternalPackages` / `experimental.serverComponentsExternalPackages` config.
201
+
203
202
  **3. Add to `.env.local`:**
204
203
 
205
204
  ```bash
206
205
  SECURENOW_LOGGING_ENABLED=1
207
206
  SECURENOW_APPID=my-nextjs-app
208
207
  SECURENOW_INSTANCE=http://localhost:4318
208
+ SECURENOW_API_KEY=snk_live_abc123...
209
209
  ```
210
210
 
211
211
  **4. Use in API routes:**
@@ -414,15 +414,21 @@ Add your API key to `.env`:
414
414
  SECURENOW_API_KEY=snk_live_abc123...
415
415
  ```
416
416
 
417
- The firewall activates automatically on startup and syncs the blocklist every 60 seconds:
417
+ The firewall activates automatically on startup and syncs the blocklist using a version-based protocol:
418
418
 
419
419
  ```
420
420
  [securenow] Firewall: ENABLED
421
421
  [securenow] Firewall: Layer 1 (HTTP 403) active
422
- [securenow] Firewall: synced 142 blocked IPs
422
+ [securenow] Firewall: synced 142 blocked IPs (138 exact + 4 CIDR ranges)
423
423
  ```
424
424
 
425
- Blocked IPs get a 403 Forbidden response. No code changes needed works with Express, Next.js, Fastify, and all Node.js frameworks.
425
+ Blocked IPs get a 403 Forbidden with a full security alert page. Changes propagate in 10-15 seconds. No code changes needed -- works with Express, Next.js, Nuxt, Fastify, and all Node.js frameworks.
426
+
427
+ **Firewall-only mode** (no tracing overhead):
428
+
429
+ ```bash
430
+ node -r securenow/firewall-only app.js
431
+ ```
426
432
 
427
433
  See the [Firewall Guide](./docs/FIREWALL-GUIDE.md) for advanced layers (TCP blocking, iptables, Cloud WAF).
428
434