Home warranties are mandatory in BC, Alberta, Manitoba, Ontario and Quebec. They’re optional (but recommended) in other jurisdictions.
Each province that mandates home warranties has requirements for what they include.