Skip to content
Back

CORS and 401 Unauthorized Issues on Appwrite Cloud (Frontend SDK)

  • 0
  • Auth
  • Cloud
Jonas @ Christ's Seeds
14 Jul, 2025, 02:13

I'm developing a frontend app using the Appwrite Web SDK on http://localhost:3000, and I'm encountering two issues when trying to register or log in users:

CORS Error: Requests to https://cloud.appwrite.io/v1/account are being blocked with the error: "No 'Access-Control-Allow-Origin' header is present..." I cannot add http://localhost:3000 as a CORS origin in the Appwrite Cloud Console (platform settings > Web App).

401 Unauthorized: Even when using the official Appwrite SDK (account.create() and account.createSession()), the requests fail with 401 Unauthorized and TypeError: Failed to fetch.

I'm not using any API keys or manual fetch() calls—only the SDK. It appears the issue is related to the Cloud-hosted Appwrite environment not allowing custom local origins.

Can you confirm if local dev origins like http://localhost:3000 are supported in Appwrite Cloud? If not, what is the recommended workaround for local development?

TL;DR
Frontend developers using Appwrite Web SDK are facing CORS error and 401 Unauthorized issues on http://localhost:3000. They cannot add localhost as a CORS origin in the Appwrite Cloud Console and requests are failing due to the Appwrite environment not allowing custom local origins. A workaround would be to use a tool like ngrok for local development.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more