title: Custom authDomain in firebase-admin SDK?
body: <p>I have been looking to the <a href="https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthgeneratesigninwithemaillink" rel="nofollow noreferrer">firebase-admin SDK documentation</a> and the <a href="https://groups.google.com/g/firebase-talk/c/1ayebmAb8ns" rel="nofollow noreferrer">discussions groups</a> and can not find any tips to generate a signInWithEmailLink with my domain server-side.</p>
  <p>Is it possible to custom the signIn link in <strong>server-side</strong> with my domain? Or is it just possible in <a href="https://cloud.google.com/identity-platform/docs/show-custom-domain" rel="nofollow noreferrer">client app</a>?</p>
  <blockquote>
  <p>Update the Callback URL with your identity provider to use your custom domain instead of the default domain. For example, change <a href="https://myproject.firebaseapp.com/__/auth/handler" rel="nofollow noreferrer">https://myproject.firebaseapp.com/__/auth/handler</a> to <a href="https://auth.mycustomdomain.com/__/auth/handler" rel="nofollow noreferrer">https://auth.mycustomdomain.com/__/auth/handler</a>.</p>
  </blockquote>
  <p>This is my actual work around but I would prefer a cleanest solution.</p>
  <pre><code>let link = await getAuth().generateSignInWithEmailLink(email, actionCodeSettings);
  
  if(link.startsWith(&quot;https://myproject.firebaseapp.com&quot;)) {
    link = link.replace(&quot;https://myproject.firebaseapp.com&quot;, process.env.AUTH_URL);
  }
  </code></pre>