Skip to content
Back

Help with custom domains

  • 0
  • Sites
  • Cloud
Marcelo Pereira
27 Jul, 2025, 19:33

Hey experts out there. Need your support with some strange behaviour.

I'm experimenting AppWrite with SSR NextJs app. on my laptop, everything runs as expected, and I could build some amazing stuff with it.

When tyring to deploy to AppWrite Sites, problems started.... while authenticating a user, cookies start to be a nightmare. It took me some days to go through the problem and identify that recomendation is to have a domain managed in Appwrite due third-party cookies. I embraced the idea, create a domain on GoDaddy and:

  • delegated DNS to Appwrite configuring NS on GoDaddy
  • create a custom domain "appwrite.<domain>" at project level and set CNAME appwrite to fra.cloud.appwrite.io
  • create a custom domain "dev.<domain>" at sites level and set CNAME dev to appwrite.network

On application, I'm using node-appwrite (server) to perform authentication but I'm getting HTTP 500 using the following code snippet:

const sdk = require("node-appwrite"); const client = new sdk.Client(); client .setEndpoint("https://appwrite.<domain>/v1") .setProject("<PROJECT_ID>") .setKey("<YOUR_API_KEY>");

In logs, I can see and error message "TypeError: fetch failed"

Does anybody face this problem? any clue on what I'm doing wrong?

thanks in advance for your help

TL;DR
Developers having trouble with custom domains and cookies while deploying NextJs app with AppWrite. Error "TypeError: fetch failed" when trying to authenticate users using node-appwrite. Solution: Ensure proper domain setup in AppWrite configuration, including delegating DNS, creating custom domains at project and site levels, and setting CNAME records correctly. Be cautious of third-party cookies.
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