50c 2.0.0 → 2.0.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/lib/config.js +3 -3
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -101,7 +101,7 @@ function loadConfigLocal() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
async function loadConfigCloud() {
|
|
104
|
-
const apiKey = process.env.FIFTY_CENT_API_KEY;
|
|
104
|
+
const apiKey = process.env.FIFTY_CENT_API_KEY || process.env.FIFTYC_API_KEY;
|
|
105
105
|
if (!apiKey) return { ...DEFAULT_CONFIG };
|
|
106
106
|
|
|
107
107
|
try {
|
|
@@ -128,7 +128,7 @@ function saveConfigLocal(config) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
async function saveConfigCloud(config) {
|
|
131
|
-
const apiKey = process.env.FIFTY_CENT_API_KEY;
|
|
131
|
+
const apiKey = process.env.FIFTY_CENT_API_KEY || process.env.FIFTYC_API_KEY;
|
|
132
132
|
if (!apiKey) throw new Error('API key required for cloud mode');
|
|
133
133
|
|
|
134
134
|
await apiRequest('PUT', '/user/config', { packs: config.packs, vault: config.vault });
|
|
@@ -137,7 +137,7 @@ async function saveConfigCloud(config) {
|
|
|
137
137
|
// API request helper
|
|
138
138
|
function apiRequest(method, endpoint, body = null) {
|
|
139
139
|
return new Promise((resolve, reject) => {
|
|
140
|
-
const apiKey = process.env.FIFTY_CENT_API_KEY || '';
|
|
140
|
+
const apiKey = process.env.FIFTY_CENT_API_KEY || process.env.FIFTYC_API_KEY || '';
|
|
141
141
|
const url = new URL(endpoint, API_URL);
|
|
142
142
|
|
|
143
143
|
const options = {
|