> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: createSecret(secret: Secret) # Method package: wixSecretsBackend # Method menu location: wixSecretsBackend --> createSecret # Method Link: https://dev.wix.com/docs/velo/apis/wix-secrets-backend/create-secret.md # Method Description: > **Deprecation Warning** > > This method will be deprecated on September 7, 2025. > > Replace with [Create Secret](https://dev.wix.com/docs/velo/apis/wix-secrets-backend-v2/secrets/create-secret.md). Creates a new secret. The createSecret() function returns a Promise that resolves to the newly created secret's ID when a secret has been created in the [Secrets Manager](https://support.wix.com/en/article/velo-working-with-the-secrets-manager). Secrets created by this function are available in the Secrets Manager section in your site's dashboard, just like any other secret created using the UI. > **Note:** > * The secret's name cannot start with `wix` or be identical to an existing secret's name. > > * Do not leave private keys in your code! Leaving them in is a security risk. Either delete the keys from the code after running `createSecret()`, or pass the parameters in using the [Functional Testing](https://support.wix.com/en/article/velo-functional-testing-in-the-backend) tool. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Create a new secret ```javascript import { Permissions, webMethod } from 'wix-web-module'; import wixSecretsBackend from 'wix-secrets-backend'; export const createNewSecret = webMethod(Permissions.Anyone, () => { const secret = { name: "s3_secret_key", value: "Fm8OfflH6bJOwWjenqAtLurLbkiMNvmhQHZV+118", description: "AWS secret access key" }; return wixSecretsBackend.createSecret(secret) .then((id) => { return id; }) .catch((error) => { console.error(error); }); }); /* * Returns a Promise that resolves to: * * "5ec36ffb-2cec-489a-9c0e-d8f53fef5fd1" */ ``` ---