We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 094c57e commit a6e21eeCopy full SHA for a6e21ee
lib/utils/sdk.js
@@ -9,10 +9,17 @@ import prompts from 'prompts'
9
import { AuthError } from './errors.js'
10
11
/**
12
- * @returns {Promise<import('@socketsecurity/sdk').SocketSdk>}
+ * The API key should be stored globally for the duration of the CLI execution
13
+ *
14
+ * @type {string | undefined}
15
*/
16
+let apiKey
17
+
18
+/** @returns {Promise<import('@socketsecurity/sdk').SocketSdk>} */
19
export async function setupSdk () {
- let apiKey = process.env['SOCKET_SECURITY_API_KEY']
20
+ if (!apiKey) {
21
+ apiKey = process.env['SOCKET_SECURITY_API_KEY']
22
+ }
23
24
if (!apiKey && isInteractive()) {
25
const input = await prompts({
0 commit comments