<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`SecretStorage`](SecretStorage) › [`setSecret`](SecretStorage/setSecret) ## SecretStorage.setSecret() method Sets a secret in the storage. **Signature:** ```typescript setSecret(id: string, secret: string): void; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | <code>id</code> | <code>string</code> | Lowercase alphanumeric ID with optional dashes | | <code>secret</code> | <code>string</code> | The secret value to store | **Returns:** `void` ## Exceptions Error if ID is invalid 1.11.4