Thanks, so for others wondering this is what I have done.
In the <script> element at the bottom of the page template I added the following;
var href = window.location.href
var qsParams = href.substring(href.indexOf("#") + 1);
var parsedQsParams = new URLSearchParams(qsParams);
var isInvite = parsedQsParams.get('type') === "invite"
the isInvite var is then used in the dict below to set the content values e.g.
title: isInvite ? "Set a password" : "Change Password",