Post conditions are used to verify that certain conditions are met when a function is called. They are not part of the smart contract, but instead are defined on the front end and are an additional layer of security the developer can add to make sure the expected actions are the only things that happen.
Here's an example of how you can add a post condition making sure that greater than or equal to a certain amount of STX was transferred.
import {
FungibleConditionCode,
makeStandardSTXPostCondition,
makeContractSTXPostCondition,
} from '@stacks/transactions';
// With a standard principal
const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
const postConditionCode = FungibleConditionCode.GreaterEqual;
const postConditionAmount = 12345n;
const standardSTXPostCondition = makeStandardSTXPostCondition(
postConditionAddress,
postConditionCode,
postConditionAmount
);
You can read more about post conditions in this tutorial: https://dev.to/stacks/understanding-stacks-post-conditions-e65