Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update create-secrets.mdx

ha-sante7dd28a5941e3
diff --git a/docs/api-reference/overview/examples/create-secrets.mdx b/docs/api-reference/overview/examples/create-secrets.mdx
index 319bd9d468..0cd731f5ff 100644
--- a/docs/api-reference/overview/examples/create-secrets.mdx
+++ b/docs/api-reference/overview/examples/create-secrets.mdx
@@ -23,6 +23,7 @@ Prerequisites:
```js
const crypto = require('crypto');
const axios = require('axios');
+const nacl = require('tweetnacl');
const ALGORITHM = 'aes-256-gcm';
const BLOCK_SIZE_BYTES = 16;
@@ -94,9 +95,9 @@ const createSecrets = async () => {
// 4. decrypt the project key with your private key
const projectKey = nacl.box.open(
util.decodeBase64(encryptedProjectKey),
- util.decodeBase64(projectKey.nonce),
- util.decodeBase64(projectKey.sender.publicKey),
- util.decodeBase64(privateKey)
+ util.decodeBase64(encryptedProjectKey.nonce),
+ util.decodeBase64(encryptedProjectKey.sender.publicKey),
+ util.decodeBase64(PSWD)
);
// 5. encrypt your secret(s) with the project key