> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# generatePassword

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

[Source: node-sdk/src/vaults.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/vaults.ts)

Generate a secure random password, the counterpart of Python's
`generate_password`. The result always contains a lowercase letter, an
uppercase letter and a digit, plus a special character unless
`includeSpecialChars` is false.

```ts theme={null}
const password = vault.generatePassword(24);
```

```typescript theme={null}
NotteVault.generatePassword(length?: number, includeSpecialChars?: boolean): string;
```

## Parameters

<ParamField body="length" type={"number"}>
  Default:

  ```typescript theme={null}
  20
  ```
</ParamField>

<ParamField body="includeSpecialChars" type={"boolean"}>
  Default:

  ```typescript theme={null}
  true
  ```
</ParamField>

## Returns

```typescript theme={null}
string
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.