@hybrd/xmtp 1.3.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybrd/xmtp",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/src/lib/jwt.ts CHANGED
@@ -65,17 +65,17 @@ export function getValidatedPayload(c: Context): XMTPToolsPayload | null {
65
65
 
66
66
  /**
67
67
  * JWT secret key used for signing and verifying tokens
68
- * Requires XMTP_JWT_SECRET environment variable in production
68
+ * Uses XMTP_ENCRYPTION_KEY environment variable for consistency
69
69
  * Only falls back to development secret in development/test environments
70
70
  */
71
71
  const JWT_SECRET = (() => {
72
- const secret = process.env.XMTP_JWT_SECRET
72
+ const secret = process.env.XMTP_ENCRYPTION_KEY
73
73
  const nodeEnv = process.env.NODE_ENV || "development"
74
74
 
75
75
  // In production, require a real JWT secret
76
76
  if (nodeEnv === "production" && !secret) {
77
77
  throw new Error(
78
- "XMTP_JWT_SECRET environment variable is required in production. " +
78
+ "XMTP_ENCRYPTION_KEY environment variable is required in production. " +
79
79
  "Generate a secure random secret for JWT token signing."
80
80
  )
81
81
  }
@@ -84,7 +84,7 @@ const JWT_SECRET = (() => {
84
84
  if (!secret) {
85
85
  console.warn(
86
86
  "⚠️ [SECURITY] Using fallback JWT secret for development. " +
87
- "Set XMTP_JWT_SECRET environment variable for production."
87
+ "Set XMTP_ENCRYPTION_KEY environment variable for production."
88
88
  )
89
89
  return "fallback-secret-for-dev-only"
90
90
  }