createSecret( )
Creates a new secret.
The createSecret()
function returns a Promise that resolves secret ID when the secret is created.
Notes:
- The secret's name cannot start with
'wix'
or be identical to an existing secret's name. - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running
createSecret()
.
Admin Method
This function requires elevated permissions and runs only on the backend and on dashboard pages.
Permission Scopes
For app development, you must have one of the following permission scopes:Manage Secrets
Learn more about permission scopes.
Method Declaration
Copy
Method Parameters
secretSecretRequired
Fields of a new secret.
Returns
Return Type:Promise<string>
Was this helpful?
Yes
No