If you create a custom endpoint for identifying a user, and proxy it through the Headless Proxy, the analytics cookie will be passed and you can successfully identify the user. The included JSS Tracking API works in the same manner.
Some notes about implementing such an API endpoint:
- Be sure to use an MVC Controller and not a Web API. Web APIs do not support session, which is required for Sitecore Analytics.
- Be sure your API path is excluded from rewriting/SSR in your headless proxy configuration.