---
url: /reference/api/logger/prompts.Variable.password.md
---
# Variable: password

```ts twoslash
// @include: imports
const password: (opts) => Promise<string | typeof CANCEL_SYMBOL>;
```

Defined in: node\_modules/.pnpm/@clack+prompts@1.9.0/node\_modules/@clack/prompts/dist/index.d.mts:803

The password prompt behaves like the [text](prompts.Variable.text.md) prompt, but the input is masked.

## Parameters

`opts`

[`PasswordOptions`](prompts.Interface.PasswordOptions.md)

## Returns

`Promise`<`string` | *typeof* [`CANCEL_SYMBOL`](prompts.Variable.CANCEL_SYMBOL.md)>

## See

https://bomb.sh/docs/clack/packages/prompts/#password-input

## Example

```ts twoslash
// @include: imports
import { password } from "@clack/prompts";

const result = await password({
  message: "Enter your password",
});
```
