Use Fusion @Endpoint in Flow .ts

Can I use a generated fusion endpoint in my flow frontend file?
When I try to call the endpoint method on client, gives me the following:

2021-04-26 21:57:53.312 INFO 21307 --- [nio-8080-exec-1] c.v.f.s.c.a.VaadinConnectAccessChecker : Invalid CSRF token in endpoint request

Are you using spring-boot?
If I understood correctly you are setting up an endpoint and then calling it in directly in the frontend. I wouldn’t do that as it seems you could be, in a way, renouncing on the framework capabilities and exposing the application to a security risk. You should be able to properly bind the java side to a custom frontend component.
Could you please tell me which is the use case ?