Most users interact with apps via their favorite Stacks wallet.
Developers can build web apps that prompt the user for an action (e.g. sign a transaction), and then the wallet will handle the rest.
Let's start by generating a random private key.
Note that this will return a different value each time you run the code.
Private keys are typically represented as hex strings in Stacks.js.
For more control you can use the PrivateKey type, which also accepts raw bytes as Uint8Array in JavaScript.