@optifye/dashboard-core 4.2.2 → 4.2.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.
package/dist/index.js CHANGED
@@ -139,8 +139,9 @@ var DEFAULT_ENDPOINTS_CONFIG = {
139
139
  whatsapp: "/api/send-whatsapp-direct",
140
140
  agnoApiUrl: process.env.NEXT_PUBLIC_AGNO_URL || "https://optifye-agent-production.up.railway.app",
141
141
  // Default AGNO API URL
142
- // Hard-coded Slack webhook so the Help page works out-of-the-box without any config
143
- slackWebhookUrl: "https://hooks.slack.com/services/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",
142
+ // Use environment variable for Slack webhook URL for privacy/security
143
+ // Note: SLACK_WEBHOOK_URL is server-side only, NEXT_PUBLIC_SLACK_WEBHOOK_URL works client-side but is less secure
144
+ slackWebhookUrl: process.env.SLACK_WEBHOOK_URL || process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL || void 0,
144
145
  slackProxyEndpoint: void 0
145
146
  };
146
147
  var DEFAULT_THEME_CONFIG = {
@@ -25156,6 +25157,17 @@ var SlackAPI = class {
25156
25157
  const config = _getDashboardConfigInstance();
25157
25158
  const endpointsConfig = config.endpoints ?? DEFAULT_ENDPOINTS_CONFIG;
25158
25159
  const { slackWebhookUrl, slackProxyEndpoint } = endpointsConfig;
25160
+ console.log("SlackAPI Debug - Configuration check:", {
25161
+ hasConfig: !!config,
25162
+ hasEndpoints: !!config.endpoints,
25163
+ slackWebhookUrl: slackWebhookUrl ? "configured" : "not configured",
25164
+ slackProxyEndpoint: slackProxyEndpoint ? "configured" : "not configured",
25165
+ envVariable: process.env.SLACK_WEBHOOK_URL ? "set" : "not set",
25166
+ publicEnvVariable: process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL ? "set" : "not set"
25167
+ });
25168
+ if (process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL && !process.env.SLACK_WEBHOOK_URL) {
25169
+ console.warn("\u26A0\uFE0F SECURITY WARNING: Using NEXT_PUBLIC_SLACK_WEBHOOK_URL exposes your webhook URL to the client. Consider using a server-side proxy instead.");
25170
+ }
25159
25171
  if (slackWebhookUrl) {
25160
25172
  const slackMessage = this.formatSlackMessage(ticket);
25161
25173
  const response = await fetch(slackWebhookUrl, {
@@ -25190,6 +25202,10 @@ var SlackAPI = class {
25190
25202
  return;
25191
25203
  }
25192
25204
  console.warn("Slack notification skipped: No webhook or proxy endpoint configured");
25205
+ console.info("To fix this, either:");
25206
+ console.info("1. Set up a server-side proxy endpoint and configure slackProxyEndpoint in your dashboard config");
25207
+ console.info("2. For development only: use NEXT_PUBLIC_SLACK_WEBHOOK_URL (not recommended for production)");
25208
+ console.info("3. Configure the webhook URL directly in your dashboard config at runtime");
25193
25209
  } catch (error) {
25194
25210
  console.error("Failed to send Slack notification:", error);
25195
25211
  throw error;
package/dist/index.mjs CHANGED
@@ -110,8 +110,9 @@ var DEFAULT_ENDPOINTS_CONFIG = {
110
110
  whatsapp: "/api/send-whatsapp-direct",
111
111
  agnoApiUrl: process.env.NEXT_PUBLIC_AGNO_URL || "https://optifye-agent-production.up.railway.app",
112
112
  // Default AGNO API URL
113
- // Hard-coded Slack webhook so the Help page works out-of-the-box without any config
114
- slackWebhookUrl: "https://hooks.slack.com/services/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",
113
+ // Use environment variable for Slack webhook URL for privacy/security
114
+ // Note: SLACK_WEBHOOK_URL is server-side only, NEXT_PUBLIC_SLACK_WEBHOOK_URL works client-side but is less secure
115
+ slackWebhookUrl: process.env.SLACK_WEBHOOK_URL || process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL || void 0,
115
116
  slackProxyEndpoint: void 0
116
117
  };
117
118
  var DEFAULT_THEME_CONFIG = {
@@ -25127,6 +25128,17 @@ var SlackAPI = class {
25127
25128
  const config = _getDashboardConfigInstance();
25128
25129
  const endpointsConfig = config.endpoints ?? DEFAULT_ENDPOINTS_CONFIG;
25129
25130
  const { slackWebhookUrl, slackProxyEndpoint } = endpointsConfig;
25131
+ console.log("SlackAPI Debug - Configuration check:", {
25132
+ hasConfig: !!config,
25133
+ hasEndpoints: !!config.endpoints,
25134
+ slackWebhookUrl: slackWebhookUrl ? "configured" : "not configured",
25135
+ slackProxyEndpoint: slackProxyEndpoint ? "configured" : "not configured",
25136
+ envVariable: process.env.SLACK_WEBHOOK_URL ? "set" : "not set",
25137
+ publicEnvVariable: process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL ? "set" : "not set"
25138
+ });
25139
+ if (process.env.NEXT_PUBLIC_SLACK_WEBHOOK_URL && !process.env.SLACK_WEBHOOK_URL) {
25140
+ console.warn("\u26A0\uFE0F SECURITY WARNING: Using NEXT_PUBLIC_SLACK_WEBHOOK_URL exposes your webhook URL to the client. Consider using a server-side proxy instead.");
25141
+ }
25130
25142
  if (slackWebhookUrl) {
25131
25143
  const slackMessage = this.formatSlackMessage(ticket);
25132
25144
  const response = await fetch(slackWebhookUrl, {
@@ -25161,6 +25173,10 @@ var SlackAPI = class {
25161
25173
  return;
25162
25174
  }
25163
25175
  console.warn("Slack notification skipped: No webhook or proxy endpoint configured");
25176
+ console.info("To fix this, either:");
25177
+ console.info("1. Set up a server-side proxy endpoint and configure slackProxyEndpoint in your dashboard config");
25178
+ console.info("2. For development only: use NEXT_PUBLIC_SLACK_WEBHOOK_URL (not recommended for production)");
25179
+ console.info("3. Configure the webhook URL directly in your dashboard config at runtime");
25164
25180
  } catch (error) {
25165
25181
  console.error("Failed to send Slack notification:", error);
25166
25182
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",