@jiggai/kitchen-plugin-marketing 0.2.7 → 0.2.8

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.
@@ -115,14 +115,25 @@
115
115
  setShowPostizSetup(false);
116
116
  void detectAll();
117
117
  };
118
+ const getStoredPostiz = () => {
119
+ try {
120
+ const stored = localStorage.getItem(`ck-postiz-${teamId}`);
121
+ if (stored) return JSON.parse(stored);
122
+ } catch {
123
+ }
124
+ return null;
125
+ };
118
126
  const detectAll = async () => {
119
127
  setDetecting(true);
120
128
  setError(null);
121
129
  try {
130
+ const stored = getStoredPostiz();
131
+ const key = postizKey || stored?.apiKey || "";
132
+ const url = postizUrl || stored?.baseUrl || "https://api.postiz.com/public/v1";
122
133
  const headers = {};
123
- if (postizKey) {
124
- headers["x-postiz-api-key"] = postizKey;
125
- headers["x-postiz-base-url"] = postizUrl;
134
+ if (key) {
135
+ headers["x-postiz-api-key"] = key;
136
+ headers["x-postiz-base-url"] = url;
126
137
  }
127
138
  const res = await fetch(`${apiBase}/providers?team=${encodeURIComponent(teamId)}`, { headers });
128
139
  const json = await res.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiggai/kitchen-plugin-marketing",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Marketing Suite plugin for ClawKitchen",
5
5
  "main": "dist/index.js",
6
6
  "files": [