How to generate csrf token manually for custom pages

I made a custom html inside www folder and also a js file in public/js file, now i am using frappe.call() to call a server side function but it is giving csrf token error and i checked in the console for csrf token then got undefined this is happening only for the custom page
but when i am inside frappe(like in homepage) then i am getting csrf token in console
so now i want to set csrf token when i am in custom page, so is there anyway where i can set csrf token for custom pages maybe by calling an api/method which generates and sets csrf token