How do I get a CSRF token on the client side?

I just enabled the CSRF filter, and some of my POST requests are getting 403s, which is kind of to be expected. And I’m getting logs like this [CSRF] Check failed because application/json for request /somePath.

This is the doc I’m reading: https://www.playframework.com/documentation/2.8.x/JavaCsrf

I still can’t find a way of getting a token on the client side, since I’m not using play forms. Can someone help me with this?

You can have Play store the CSRF token in a cookie using the play.filters.csrf.cookie.name configuration key and then pull the token out of the cookie in your client code to be included in requests against the server.