Embedded widget does not show any data
Describe the bug When creating a new embedded widget, no data is shown. I'm self hostng Rybbit with Dokploy, I have set it up with a custom subdomain, everything works just fine except for this widget. In the environment variables I have set up DOMAIN_NAME and BASE_URL. The embedding script itself looks fine:
However the widget itself loaded via https://<mydomain.com>/widget/ shows no data, and when inspecting the widget page source code I found this:
(function () {
var cfg = {"siteId":"5cdea9fc100b","minutes":30,"chart":true,"countries":true,"backendUrl":"http://localhost:3001/api"}; var countEl = document.getElementById("count"); var chartEl = document.getElementById("chart"); var countriesEl = document.getElementById("countries");
Notice the localhost URL. I dug through Rybbit's source code and it seems that if it does not detect DOMAIN_NAME or BASE_URL then it uses localhost as fallback: https://github.com/rybbit-io/rybbit/blob/c7aeadaddaee70d9ebfbff5f89d953f5fcedab02/client/src/app/widget/%5BsiteId%5D/route.ts#L12
So it seems that the application is not recognizing my environment variables, or is expecting other variables, or variables somewhere else.
Expected behavior The embedded widget page source code should contain: {"siteId":"5cdea9fc100b","minutes":30,"chart":true,"countries":true,"backendUrl":"https://<mydomain.com>/api"};
Desktop:
- OS: Windows
- Browser: Microsoft Edge
- Version: 152
Source: rybbit-io/rybbit