Skip to content

One web app, every subdomain

A SaaS with a subdomain per company needs one app and one key in Takeed.

  1. Add https://*.your-saas.com to the app's allowed origins.
  2. Serve the same init code and the same worker file on every subdomain.
  3. Each subscription records the subdomain it came from; the platform tags the user with company = <subdomain>. If the app has a branch with that slug, the device joins the branch too.

A new subdomain works immediately, with no setup in the dashboard.

Sending to one company#

json
{
  "app_id": "YOUR-APP-ID",
  "contents": {"en": "Your report is ready"},
  "filters": [{"field": "tag", "key": "company", "relation": "=", "value": "acme"}]
}

or, with branches, "target": "saas:acme", or a branch key for that company.

Relative links ("url": "/reports/7") open on the subdomain the user subscribed from. Reports can be filtered by company.

Limits set by browsers#

  • Permission is asked on each subdomain separately.
  • On iPhone, web push works only for sites added to the home screen.
  • Custom company domains work the same way: HTTPS, the worker file on that domain, and the domain in the allowed origins.
  • A Web Push subscription is not shared between origins; each domain creates its own subscription even for the same signed-in user.

Try it on your own number: your first organization comes with 5 free WhatsApp codes.

Create account