MediaOS Hub provides a streamlined way to link directly to embeddable tools like login forms, registration, profiles, and more—without creating dedicated pages. This is ideal for fast deployment of MediaOS components across your site.
What Is MediaOS Hub?
MediaOS Hub is a lightweight router that allows you to display embeddable MediaOS components (like <mediaos-login-form>, <mediaos-register-form>, and others) by linking directly to a Hub route, such as:
https://yourdomain.com/hub/login-form
It eliminates the need to create separate template pages for each feature. You simply link to the Hub route, and the corresponding component loads dynamically.
Enabling MediaOS Hub
To activate MediaOS Hub on your site, you need to include the following values in your window.mediaos JavaScript object.
<script>
window.mediaos = {
mediaos_version: 2,
hub_enabled: true
};
</script>
Note: mediaos_version must be set to 2 in order for Hub functionality to be recognized.
Tip: You can still include all normal window.mediaos metadata (like post_id, title, etc.) alongside the hub_enabled flag.
Example Usage
Let’s say you want to display the MediaOS login form without building a custom page. Just link users to:
https://yourdomain.com/hub/login-form
This URL will dynamically load the <mediaos-login-form> component into the main content area of your site.
Other Common Examples
Route | Component Displayed |
---|---|
/hub/login-form | <mediaos-login-form> |
/hub/register-form | <mediaos-register-form> |
/hub/user-profile | <mediaos-user-profile> |
/hub/newsletter-manage | <mediaos-newsletter-manage> |
/hub/comment-feed | <mediaos-comment-feed> |
Tip: You can also pass query parameters to these URLs. For example:
https://yourdomain.com/hub/expo-directory?id=1
When to Use MediaOS Hub
Use Hub-based routing when:
- You want to avoid creating standalone pages for common MediaOS components.
- You need to quickly deploy modals, forms, or tools without developer assistance.
- You want to keep your templates clean and reusable.
Warning: Hub will only work if it is enabled via window.mediaos as shown above. If the page does not include mediaos_version: 2 and hub_enabled: true, routing will not function.