> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/build/totp.md).

# Generate a TOTP code in Duaer

In Duaer, TOTP defaults to Operation Generate Secret. Under Options, Algorithm defaults to SHA1, Digits to 6, and Period to 30. You need a totpApi credential (label and secret).
## Generate the current code

1. Create a totpApi credential with Label and Secret.
2. Search for TOTP, connect it after the previous node, and select that credential.
3. Leave Operation on Generate Secret.
4. Optionally change Algorithm, Digits, or Period under Options.
5. Select Execute step. The current code appears in the output.

Keep the shared Secret in the credential. Do not put it in plain text on the canvas.

Related crypto nodes: [Sign a token with JWT in Duaer](/build/jwt.md) and [Hash a value with Crypto in Duaer](/build/crypto.md).
## Questions

### Does Generate Secret in Duaer’s TOTP create a new key each run?

No. Despite the Operation name, it generates the current code from the secret stored in the credential.

## Related

- [Sign a token with JWT in Duaer](https://doc.duaer.com/build/jwt.md)
- [Hash a value with Crypto in Duaer](https://doc.duaer.com/build/crypto.md)
- [Call an API with HTTP Request in Duaer](https://doc.duaer.com/build/http-request.md)

