Page ConfigurationDomain Setup

Page Domain Setup

Configure where your Doupple chat page is hosted. You can use the default Doupple domain or deploy it on your own custom domain.

Domain Setup Tab

The Domain Setup tab in your agent settings lets you configure the hosting location for your help/chat page.

You have two options:

Use the default Doupple domain — Your page is automatically available at https://app.doupple.com/chat/[agentId]
Deploy on your own domain — Proxy the page under a path like /chat or /support on your website
What is a rewrite/proxy? A rewrite acts as a proxy. When a user visits a path on your domain, your server fetches content from Doupple and serves it to the user. The URL in the browser bar does not change, making it appear as though the page is hosted on your domain.

How to implement

Choose the implementation method that matches your website's framework or hosting platform:

Next.js

Configure rewrites in your next.config.js file.

// next.config.js
const nextConfig = {
  async rewrites() {
    return [
      {
        source: "/chat",
        destination: "https://app.doupple.com/chat/[agentId]",
      },
      {
        source: "/chat/:path*",
        destination: "https://app.doupple.com/chat/[agentId]/:path*",
      },
    ];
  },
};

module.exports = nextConfig;

Replace [agentId] with your actual agent ID and restart your dev server.

Vercel

If you host on Vercel, create or update your vercel.json file.

{
  "rewrites": [
    {
      "source": "/chat",
      "destination": "https://app.doupple.com/chat/[agentId]"
    },
    {
      "source": "/chat/:path*",
      "destination": "https://app.doupple.com/chat/[agentId]/:path*"
    }
  ]
}

Commit and push to deploy. Vercel automatically applies the rules on the next build.

Express.js (Node.js)

Use http-proxy-middleware to create a rewrite.

const express = require("express");
const { createProxyMiddleware } = require("http-proxy-middleware");

const app = express();
const AGENT_ID = process.env.DOUPPLE_AGENT_ID || "[agentId]";

const chatProxy = createProxyMiddleware({
  target: "https://app.doupple.com",
  changeOrigin: true,
  pathRewrite: {
    "^/chat": `/chat/${AGENT_ID}`,
  },
});

app.use("/chat", chatProxy);
app.listen(3000, () => console.log("Server running on port 3000"));

Other Platforms

For other hosting platforms (Netlify, Firebase, AWS, etc.), consult your platform's documentation on how to set up rewrites or proxies. The core concept is the same:

Source: /chat and /chat/:path*

Destination: https://app.doupple.com/chat/[agentId]

Best practices

Always replace [agentId] with your actual agent ID from the Doupple dashboard
Test the rewrite on your staging environment before deploying to production
Use environment variables to store your agent ID securely
Monitor your proxy logs to ensure requests are being forwarded correctly
Need help? Reach out to our support team at support@doupple.com