Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Prepare docs for Swetrix CE v5

Blue Mouse47a355216e30
diff --git a/docs/docs/captcha/client-side-usage.md b/docs/docs/captcha/client-side-usage.md
index ba33ce76b..4785b01ff 100644
--- a/docs/docs/captcha/client-side-usage.md
+++ b/docs/docs/captcha/client-side-usage.md
@@ -42,7 +42,7 @@ You can customise the appearance of the CAPTCHA widget by adding the following a
| `data-project-id` | string | The ID of your CAPTCHA project (REQUIRED). |
| `data-theme` | string | The theme of the CAPTCHA widget. Possible values: `auto` (default), `light`, `dark`. |
| `data-response-input-name` | string | Name of the token input element. Default: `swetrix-captcha-response`. |
-| `data-api-url` | string | The URL of the CAPTCHA API. Default: `https://api.swetrixcaptcha.com/v1/captcha`. If you're self-hosting Swetrix CE, you should put the URL of your API instance here, like `[API_URL]/v1/captcha`. Swetrix Cloud users should leave it as is. |
+| `data-api-url` | string | The URL of the CAPTCHA API. Default: `https://api.swetrixcaptcha.com/v1/captcha`. If you're self-hosting Swetrix CE, you should put the URL of your API instance here, like `[BASE_URL]/backend/v1/captcha`. Swetrix Cloud users should leave it as is. |
| `data-lang` | string | Force a specific language for the widget (see [Language support](#language-support)). |
### Language support
diff --git a/docs/docs/script-reference.md b/docs/docs/script-reference.md
index 50785a100..fd6a2b59b 100644
--- a/docs/docs/script-reference.md
+++ b/docs/docs/script-reference.md
@@ -34,7 +34,7 @@ swetrix.init('YOUR_PROJECT_ID', {
| devMode | When set to `true`, localhost events will be sent to server. | `false` |
| disabled | When set to true, the tracking library won't send any data to server.<br />Useful for development purposes when this value is set based on '.env' var. | `false` |
| respectDNT | By setting this flag to true, we will not collect ANY kind of data about the user with the DNT setting. <br />This setting is not true by default because our service anonymises all incoming data and does not pass it on to any third parties under any circumstances. | `false` |
-| apiURL | Set a custom URL of the API server (for selfhosted variants of Swetrix). | `'https://api.swetrix.com/log'` |
+| apiURL | If you use Swetrix Cloud, you don't need to change this parameter. If you're self-hosting Swetrix CE, you should put the URL of your API instance here, like `[BASE_URL]/backend/v1/log`. | `'https://api.swetrix.com/log'` |
| profileId | Optional profile ID for long-term user tracking (MAU/DAU). If set, it will be used for all pageviews and events unless overridden per-call. This allows you to track users across sessions and devices. | `undefined` |
## track()
diff --git a/docs/docs/selfhosting/configuring.md b/docs/docs/selfhosting/configuring.md
index 59312168b..d1d819bf4 100644
--- a/docs/docs/selfhosting/configuring.md
+++ b/docs/docs/selfhosting/configuring.md
@@ -13,18 +13,10 @@ The following environment variables are available for configuration:
| Variable | Default | Description |
| --------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
-| `API_URL` | `http://localhost:8080/` | URL of the self-hosted Swetrix API instance. Swetrix frontend will use this variable to connect to the API, so make sure it's correct. |
-
-:::caution
-Swetrix Community Edition is split into two containers: `swetrix` (frontend - the frontend web UI) and `swetrix-api` (backend - the API server, that does auth, data logging, etc.). The `API_URL` variable on the frontend container must point to the _backend_ container, which by default is `http://localhost:8080/`.
-
-So if you're self-hosting on subdomains, you might run swetrix.mydomain.com proxied to port 80 for the frontend user interface (where you log in), and swetrix-api.mydomain.com proxied to port 8080, and set `API_URL=https://swetrix-api.mydomain.com`.
-
-This is the most common issue users encounter when self-hosting Swetrix Community Edition, so please make sure to set it correctly.
-:::
+| `BASE_URL` | `http://localhost:8080/` | Public URL of your Swetrix CE instance. |
:::tip
-The `API_URL` must be publicly reachable from your users' browsers. Do not set it to a Docker network hostname like `http://swetrix-api:8080` or `http://swetrix-api:5005`. Use a public domain or IP that resolves from the internet, for example `https://api.example.com`.
+The `BASE_URL` must be publicly reachable from your users' browsers. Do not set it to a Docker network hostname like `http://swetrix-api:8080` or `http://swetrix-api:5005`. Use a public domain or IP that resolves from the internet, for example `https://statistics.example.com`.
:::
## Backend (swetrix-api image)
@@ -65,6 +57,7 @@ Swetrix Community Edition also supports OIDC authentication. To enable it, you n
| `OIDC_DISCOVERY_URL` | | URL of the OIDC discovery endpoint, for example `https://example.com/.well-known/openid-configuration` |
| `OIDC_CLIENT_ID` | | OIDC client ID |
| `OIDC_CLIENT_SECRET` | | OIDC client secret |
+| `OIDC_PROMPT` | `select_account` | OIDC prompt |
## Redis
diff --git a/docs/docs/selfhosting/how-to.md b/docs/docs/selfhosting/how-to.md
index b9ae725ab..a26ae8662 100644
--- a/docs/docs/selfhosting/how-to.md
+++ b/docs/docs/selfhosting/how-to.md
@@ -75,7 +75,3 @@ To update Swetrix to the latest version, please refer to the changelog on our [G
If you use reverse proxy like Nginx, please set it up to pass the request IP address as the `x-real-ip` header, otherwise it may cause the problems related to API route rate limiting and analytics sessions. If the `x-real-ip` header is undefined, Swetrix will use `x-forwarded-for` or the request IP address as a backup.
If you are using proxy for your self-hosted Swetrix instance, you should set the `CLIENT_IP_HEADER` environment variable. For example, if your proxy is Cloudflare, then you should set `CLIENT_IP_HEADER` to `cf-connecting-ip`.
-
-:::caution
-If you use Cloudflare Tunnel, avoid nested subdomains such as `api.swetrix.example.com` which may not be supported in some Tunnel setups. Prefer a single-label subdomain like `swetrixapi.example.com`, and set `API_URL` to that public URL.
-:::
diff --git a/web/README.md b/web/README.md
deleted file mode 100644
index 55bc0b36c..000000000
--- a/web/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-<picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://swetrix.com/assets/logo_white.png">
- <img alt="" src="https://swetrix.com/assets/logo_blue.png" height="80">
-</picture>
-<br /><br />
-
-[![Dockerhub pulls](https://img.shields.io/docker/pulls/swetrix/swetrix-fe.svg?style=flat)](https://hub.docker.com/r/swetrix/swetrix-fe)
-[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/swetrix/swetrix-fe/issues)
-
-## Description
-
-Swetrix is a privacy-oriented, simple and fully cookie-less web analytics service.\
-It provides lots of metrics like unique visitors, live visitors monitoring, custom events, pageviews and many more.
-
-The service also supports many other features, like dashboard metrics & GDPR exports, email reports and more.
-
-The project's purpose is to fight web analytics giants like Google Analytics while providing better quality and experience of using service.
-
-## License
-
-Swetrix is released under the AGPL v3.0 licence, see [LICENSE](LICENSE).
-
-## Install Swetrix
-
-See the API installation process at https://github.com/Swetrix/swetrix-api#readme. \
-To selfhost the frontend part of Swetrix, you simply need to set up `.env` variables, install the dependencies (`npm i`), build the code (`npm run build`) and host it as a regular React application ([how to host react apps](https://create-react-app.dev/docs/deployment/)).\
-On production, swetrix.com uses Cloudflare Pages to host the frontend part of the application.\
-The minimum supported NodeJS version is v14.
-
-### Docker Setup
-
-Swetrix provides a Docker Image based on Alpine, Nginx and Node.
-To use it you just just pull `swetrix/swetrixfe` from dockerhub.
-
-#### Docker Environment Variables
-
-The following environment variables are available, alongside their default values.
-`API_URL` = `https://example.com/` | The URL of the Swetrix API
-`TZ` = `Etc/UTC` | Sets the Timezone of the Container
-
-## Bugs and security
-
-Swetrix is open to pull-requests. Feel free to propose new features or submit bug requests via pull reuqests.\
-For severe security issues, please contact us at [email protected]
-
-## Contributions
-
-Contributions are welcome! You can find and pick any task on our [public roadmap](https://github.com/orgs/Swetrix/projects/2) page.\
-Feel free to also offer any feature or improvement proposal, all of it is highly appreciated!\
-You can also contribute translations on your [Crowdin](https://crowdin.com/project/swetrix) page.
-
-## Contact
-
-You can contact us via email at [email protected]
-
-## Donate
-
-You can support the project by donating us at https://ko-fi.com/andriir \
-We can only run our services by once again asking for your financial support!