Hi @iamnjain,
If I good understand you are trying to short urls in SPA in the same way you would do that using HTL, right?
If so, then this will not work, this is one of the limitations of SPA, you can find all the limitations under https://experienceleague.adobe.com/docs/experience-manager-cloud-se...