How to fix auth/invalid-dynamic-link-domain: Dynamic link domain not configured in Firebase

FirebaseINTERMEDIATEMEDIUMUpdated Dec 22, 2025ยท 137 views

This Firebase Authentication error occurs when your app tries to use a dynamic link domain that hasn't been configured or authorized for your Firebase project. The fix involves configuring dynamic link domains in the Firebase Console and updating your app's configuration.

Quick fix

Fixes auth/invalid-dynamic-link-domain

import { getAuth, sendPasswordResetEmail } from "firebase/auth";

const auth = getAuth();
const actionCodeSettings = {
  // Use 'linkDomain' instead of deprecated 'dynamicLinkDomain'
  linkDomain: "yourproject.page.link", // Your configured domain
  // OR for custom domains:
  // linkDomain: "links.example.com",

  // Other required settings:
  url: "https://yourapp.com/reset-password", // Your app's reset page
  handleCodeInApp: true, // Set to true for mobile apps
};

// Example: Send password reset email
sendPasswordResetEmail(auth, "user@example.com", actionCodeSettings)
  .then(() => {
    console.log("Password reset email sent!");
  })
  .catch((error) => {
    console.error("Error:", error.code, error.message);
  });
  1. Check if Dynamic Links is enabled in your Firebase project
  2. Configure your dynamic link domain in Firebase Console
  3. Update your app's ActionCodeSettings configuration
  4. Test the configuration
firebase โ€” error
import { getAuth, sendPasswordResetEmail } from "firebase/auth";
const auth = getAuth();
const actionCodeSettings = {
// Use 'linkDomain' instead of deprecated 'dynamicLinkDomain'
linkDomain: "yourproject.page.link", // Your configured domain
// OR for custom domains:
// linkDomain: "links.example.com",
// Other required settings:
url: "https://yourapp.com/reset-password", // Your app's reset page
handleCodeInApp: true, // Set to true for mobile apps
};
// Example: Send password reset email
sendPasswordResetEmail(auth, "user@example.com", actionCodeSettings)
.then(() => {
console.log("Password reset email sent!");
})
.catch((error) => {
console.error("Error:", error.code, error.message);
});
auth/invalid-dynamic-link-domain: Dynamic link domain not configured

What this error means

The "auth/invalid-dynamic-link-domain" error in Firebase Authentication indicates that your application is attempting to use a dynamic link domain that hasn't been properly configured for your Firebase project. Dynamic links are used in Firebase Authentication for email actions (password reset, email verification) and other scenarios where users need to be redirected back to your app. When Firebase generates a dynamic link for authentication purposes, it needs to know which domain to use. If you specify a domain in your `ActionCodeSettings` that hasn't been configured in the Firebase Console, or if you're using the deprecated `dynamicLinkDomain` parameter, Firebase will throw this error. This error commonly appears when: 1. You've recently set up a new Firebase project and haven't configured dynamic links 2. You're migrating from an old Firebase project and the domain configuration didn't transfer 3. You're using a custom domain that hasn't been added to your Firebase project 4. You're using the deprecated `dynamicLinkDomain` parameter instead of `linkDomain`

Typical symptoms

  • Firebase Authentication email actions (password reset, email verification) fail
  • Error appears when calling methods like `sendPasswordResetEmail()` or `verifyEmail()`
  • Users don't receive authentication emails or links don't work
  • Error appears in Firebase console logs with code 'auth/invalid-dynamic-link-domain'
  • Mobile app deep linking for authentication flows fails

Common causes

  1. Dynamic link domain not configured in Firebase Console (most common)
  2. Using a custom domain that hasn't been added to Firebase project
  3. Using the deprecated `dynamicLinkDomain` parameter instead of `linkDomain`
  4. Firebase project doesn't have Dynamic Links enabled
  5. Incorrect domain format in ActionCodeSettings configuration
  6. Domain configuration was removed or modified in Firebase Console
  7. Using a subdomain that hasn't been properly configured

How to fix "auth/invalid-dynamic-link-domain: Dynamic link domain not configured"

1Check if Dynamic Links is enabled in your Firebase project

First, verify that Dynamic Links is enabled for your Firebase project:

1. Go to the [Firebase Console](https://console.firebase.google.com/)
2. Select your project
3. In the left sidebar, click on "Dynamic Links"
4. If you see a "Get Started" button, click it to enable Dynamic Links
5. If it's already enabled, you'll see your existing dynamic links

If Dynamic Links isn't enabled, you need to enable it before proceeding.

2Configure your dynamic link domain in Firebase Console

Configure your dynamic link domain:

Option A: Use a free page.link subdomain (recommended for testing):

1. In Firebase Console > Dynamic Links
2. Click "Get Started" or "New Dynamic Link"
3. Firebase will automatically assign you a free subdomain like yourproject.page.link
4. Note this domain for use in your app

Option B: Use a custom domain:

1. In Firebase Console > Dynamic Links
2. Click "Add URL prefix"
3. Enter your custom domain (e.g., links.example.com)
4. Follow the DNS verification steps:
- Add the provided TXT record to your domain's DNS
- Wait for DNS propagation (can take up to 48 hours)
- Click "Verify" in Firebase Console

Important: The domain must use HTTPS and have a valid SSL certificate.

3Update your app's ActionCodeSettings configuration

Update your Firebase Authentication code to use the correct domain:

For web apps (JavaScript/TypeScript):

javascript
import { getAuth, sendPasswordResetEmail } from "firebase/auth";

const auth = getAuth();
const actionCodeSettings = {
  // Use 'linkDomain' instead of deprecated 'dynamicLinkDomain'
  linkDomain: "yourproject.page.link", // Your configured domain
  // OR for custom domains:
  // linkDomain: "links.example.com",

  // Other required settings:
  url: "https://yourapp.com/reset-password", // Your app's reset page
  handleCodeInApp: true, // Set to true for mobile apps
};

// Example: Send password reset email
sendPasswordResetEmail(auth, "user@example.com", actionCodeSettings)
  .then(() => {
    console.log("Password reset email sent!");
  })
  .catch((error) => {
    console.error("Error:", error.code, error.message);
  });

For mobile apps (React Native/Flutter):
Configure your deep linking according to Firebase documentation.

4Test the configuration

Test your dynamic link configuration:

1. Send a test email:

javascript
// Send a password reset email to yourself
   sendPasswordResetEmail(auth, "your-email@example.com", actionCodeSettings);

2. Check the email:
- Open the password reset email
- Click the link
- Verify it redirects to your app correctly

3. Test on different platforms:
- Test on web browser
- Test on iOS device
- Test on Android device

4. Check Firebase Console logs:
- Go to Firebase Console > Authentication > Events
- Look for any errors related to dynamic links

5Handle the deprecated dynamicLinkDomain parameter

If you're using the deprecated dynamicLinkDomain parameter, update your code:

Before (deprecated):

javascript
const actionCodeSettings = {
  dynamicLinkDomain: "yourproject.page.link", // DEPRECATED
  url: "https://yourapp.com/reset-password",
  handleCodeInApp: true,
};

After (correct):

javascript
const actionCodeSettings = {
  linkDomain: "yourproject.page.link", // CORRECT
  url: "https://yourapp.com/reset-password",
  handleCodeInApp: true,
};

Note: The dynamicLinkDomain parameter was deprecated because Firebase now supports custom Hosting link domains through the linkDomain parameter.

6Verify iOS and Android app configuration

For mobile apps, ensure proper configuration:

iOS (Xcode project):
1. Open your Xcode project
2. Go to Target > Info > URL Types
3. Add a URL Scheme matching your bundle ID
4. Configure Associated Domains in Capabilities:
- Add: applinks:yourproject.page.link
- Or for custom domains: applinks:links.example.com

Android (AndroidManifest.xml):

xml
<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data
    android:host="yourproject.page.link"
    android:scheme="https" />
</intent-filter>

Firebase Console configuration:
1. Go to Firebase Console > Project Settings
2. Add your iOS bundle ID and Android package name
3. Download updated config files for each platform

Advanced notes

### Understanding Dynamic Link Domains

Firebase Dynamic Links can use two types of domains:

1. Free page.link subdomains: Automatically provided by Firebase (e.g., yourproject.page.link). These are easiest to set up and work immediately.

2. Custom domains: Your own domain (e.g., links.example.com). Requires DNS verification but provides branding consistency.

### Common Migration Scenarios

Migrating from old Firebase project:
If you're migrating from an old Firebase project, dynamic link domains don't automatically transfer. You need to:
1. Reconfigure the domain in the new project
2. Update DNS records if using custom domain
3. Update your app's configuration

Changing domains:
If you need to change your dynamic link domain:
1. Configure the new domain in Firebase Console
2. Update your app's linkDomain setting
3. Keep the old domain active during transition (users may have old links)
4. Update mobile app configurations

### Troubleshooting Tips

1. DNS propagation delays: Custom domain changes can take 24-48 hours to propagate globally.

2. SSL certificate issues: Ensure your custom domain has a valid SSL certificate. Firebase requires HTTPS.

3. App store updates: Changing dynamic link domains may require app store updates if deep linking configuration changes.

4. Testing environments: Use different domains for development, staging, and production.

5. Firebase project permissions: Ensure you have sufficient permissions to configure Dynamic Links in the Firebase Console.

### Security Considerations

- Dynamic links can be used for phishing if not properly secured
- Always verify link domains in your app
- Consider implementing additional security checks for sensitive operations
- Monitor Firebase Console for suspicious activity

### Performance Implications

- Dynamic links add an extra redirect layer
- Consider caching strategies for frequently accessed authentication flows
- Monitor link click-through rates in Firebase Analytics

Frequently asked questions

What does "auth/invalid-dynamic-link-domain" mean?
The "auth/invalid-dynamic-link-domain" error in Firebase Authentication indicates that your application is attempting to use a dynamic link domain that hasn't been properly configured for your Firebase project. Dynamic links are used in Firebase Authentication for email actions (password reset, email verification) and other scenarios where users need to be redirected back to your app. When Firebase generates a dynamic link for authentication purposes, it needs to know which domain to use.
How do I fix "auth/invalid-dynamic-link-domain"?
This Firebase Authentication error occurs when your app tries to use a dynamic link domain that hasn't been configured or authorized for your Firebase project. The fix involves configuring dynamic link domains in the Firebase Console and updating your app's configuration.
What causes "auth/invalid-dynamic-link-domain"?
Dynamic link domain not configured in Firebase Console (most common) Using a custom domain that hasn't been added to Firebase project Using the deprecated dynamicLinkDomain parameter instead of linkDomain
Is the "auth/invalid-dynamic-link-domain" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading