> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/data-api-sdk/mobile-sdk-setup-permissions-and-crashes/auth-token-generate-server-side.md).

# Why does generateAuthToken hit a CORS error?

Two separate things are happening here:

* **Build failure after SDK setup:** check for a duplicate package dependency added via SwiftPM and remove it.
* **CORS error on `generateAuthToken`:** this endpoint is meant to be **called from your backend, not the browser**, so CORS errors from web origins are expected. Calling it server-side also keeps your API key from being exposed.
