- Updated: March 22, 2026
- 4 min read
Building a Self‑Service Customer Portal for OpenClaw Tenants
Building a Self‑Service Customer Portal for OpenClaw Tenants
OpenClaw provides a powerful platform for managing multi‑tenant SaaS applications. To give each tenant a seamless, self‑service experience, developers often need a dedicated customer portal that handles UI, authentication, billing, and monitoring. In this guide we walk through the creation of a full‑stack portal that runs natively on UBOS, integrates with the existing Stripe billing backend, and surfaces tenant‑specific metrics via Grafana.
1. Front‑end UI Architecture
The UI is built with React and Tailwind CSS to keep the codebase lightweight and responsive. The portal consists of three main sections:
- Dashboard – a landing page showing tenant usage, recent invoices, and quick links to Grafana.
- Billing – a view that pulls Stripe subscription data, displays upcoming invoices, and lets users update payment methods.
- Settings – profile management and API key generation.
All components are bundled with Vite for fast development and are served as static assets from the UBOS www directory, ensuring zero‑maintenance hosting.
2. Authentication Flow
UBOS ships with an integrated auth service that supports JWT‑based authentication. The flow is:
- User enters email/password on the login page.
- The front‑end calls
/api/auth/login(exposed by UBOS) which validates credentials against the OpenClaw user store. - On success, a signed JWT is returned and stored in
localStorage. - Every subsequent request includes the token in the
Authorization: Bearer <token>header. - The token contains the tenant ID, allowing the back‑end to scope all data queries automatically.
For password‑reset and email verification, UBOS provides webhook endpoints that can be hooked into the existing OpenClaw notification service.
3. Integration with Stripe Billing
The portal does not store any credit‑card data. Instead, it uses Stripe’s client‑side SDK to collect payment details and creates a SetupIntent. The back‑end (a small Node.js micro‑service running on UBOS) then calls Stripe’s REST API to:
- Retrieve the current subscription and plan details.
- Generate upcoming invoices.
- Update the payment method securely.
All Stripe secrets are stored in UBOS secret vault, keeping them out of the code repository.
4. Grafana Dashboard Embedding
Each tenant has a dedicated Grafana dashboard that visualises usage metrics collected by OpenClaw. To embed these dashboards securely:
- Generate a short‑lived
auth tokenfor the tenant using Grafana’s/api/auth/keysendpoint. - Pass the token as a query parameter when loading the iframe:
https://grafana.ubos.tech/d/tenant‑{id}?orgId=1&auth_token=<token>. - The iframe is sandboxed to prevent click‑jacking, and the token expires after 5 minutes.
This approach gives tenants a real‑time view of their resources without leaving the portal.
5. Deploying on UBOS – Seamless Experience
UBOS abstracts away the underlying infrastructure. To publish the portal:
- Package the front‑end build output (
dist/) and the Node.js service into a Docker image. - Push the image to the UBOS registry.
- Run
ubos app install my‑portal– UBOS automatically creates the container, configures networking, and injects the required environment variables (Stripe keys, Grafana URL, etc.). - UBOS also provisions a TLS‑enabled domain (e.g.,
portal.my‑tenant.ubos.tech) and adds a reverse‑proxy rule.
The result is a fully managed, production‑ready portal that scales with the underlying UBOS cluster.
6. One‑click Access to OpenClaw Hosting
Developers looking for a quick start can host OpenClaw on UBOS with a single command. This link provides the exact context for the portal’s back‑end and ensures all required services (PostgreSQL, Redis, Grafana) are pre‑configured.
Conclusion
By leveraging UBOS’s built‑in authentication, secret management, and container orchestration, you can deliver a polished self‑service portal that integrates Stripe billing and Grafana monitoring with minimal operational overhead. The architecture described above is modular, secure, and ready for production deployment today.