@rely-net/sdk 1.0.3 → 1.0.4

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 +40 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,46 @@ Official SDK for [rely.net](https://rely.net) — monitor your application from
17
17
  npm install @rely-net/sdk
18
18
  ```
19
19
 
20
+ ## Install with a coding agent
21
+
22
+ Paste the prompt below into Claude Code, Codex, Cursor, or your agent of choice. It will install the SDK, wire up health checks for the services your app actually depends on, and integrate the Next.js middleware.
23
+
24
+ ```
25
+ Install the @rely-net/sdk package to monitor this Next.js app.
26
+
27
+ Do the following:
28
+
29
+ 1. Install the package:
30
+ npm install @rely-net/sdk
31
+
32
+ 2. Create /instrumentation.ts at the project root with:
33
+ - A Rely client initialized from process.env.RELY_API_KEY
34
+ - One healthCheck() for each external service this app depends on.
35
+ Look through the codebase for env vars like SUPABASE_*, STRIPE_*,
36
+ ANTHROPIC_API_KEY, OPENAI_*, and add a health check for each.
37
+ Use the patterns in the README below.
38
+
39
+ 3. Update middleware.ts to wrap the existing middleware with
40
+ withRelyMiddleware(rely, existingMiddleware). If there is no existing
41
+ middleware, export withRelyMiddleware(rely) directly. Keep the matcher
42
+ excluding _next/static, _next/image, and favicon.ico.
43
+
44
+ 4. Add RELY_API_KEY= to .env.local and mention that the user needs to
45
+ get their API key from rely.net/settings/api-keys and add it to
46
+ production env vars as well.
47
+
48
+ 5. Run a build to verify nothing is broken.
49
+
50
+ Reference README with health check snippets for common services:
51
+ https://github.com/mdicarlo-scaled/rely-net
52
+
53
+ The SDK automatically wraps global fetch to track outgoing vendor
54
+ calls (Stripe, Anthropic, Supabase, etc.) with p50/p95/p99 latency and
55
+ error rates, so no additional code is needed beyond the above steps.
56
+ ```
57
+
58
+ For non-Next.js frameworks, drop step 3 (the middleware integration).
59
+
20
60
  ## Quick start (Next.js)
21
61
 
22
62
  ### 1. Get your API key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-net/sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Official SDK for rely.net — monitor your app from the inside",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",