Files
website/docs/dive-deeper/make-clients.html
github-actions[bot] 1bb0ee3fe5 deploy: c510b9c2b5
2025-07-10 03:23:56 +00:00

22 lines
19 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-dive-deeper/make-clients">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.4.1">
<title data-rh="true">Making Clients | Stardust XR</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://stardustxr.org/docs/dive-deeper/make-clients"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Making Clients | Stardust XR"><meta data-rh="true" name="description" content="A Stardust client is at its core an executable that connects to a stardust server instance at $XDGRUNTIMEDIR/stardust-[0-32], sends and receives messages according to the Stardust protocol."><meta data-rh="true" property="og:description" content="A Stardust client is at its core an executable that connects to a stardust server instance at $XDGRUNTIMEDIR/stardust-[0-32], sends and receives messages according to the Stardust protocol."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://stardustxr.org/docs/dive-deeper/make-clients"><link data-rh="true" rel="alternate" href="https://stardustxr.org/docs/dive-deeper/make-clients" hreflang="en"><link data-rh="true" rel="alternate" href="https://stardustxr.org/docs/dive-deeper/make-clients" hreflang="x-default"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Stardust XR RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Stardust XR Atom Feed">
<script src="https://plausible.fyralabs.com/js/script.hash.outbound-links.js" defer="defer" data-domain="stardustxr.org"></script><link rel="stylesheet" href="/assets/css/styles.c46a9385.css">
<link rel="preload" href="/assets/js/runtime~main.6124d2b9.js" as="script">
<link rel="preload" href="/assets/js/main.0fbbb017.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus">
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/icon.webp" alt="Stardust XR logo, a yellow astroid with smaller white astroids around it" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">Stardust XR</b></a></div><div class="navbar__items navbar__items--right"><a href="https://twitter.com/stardustxr" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://discord.gg/A9w7fKE" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://matrix.to/#/#stardustxr:matrix.org" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Matrix<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://github.com/StardustXR" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://github.com/sponsors/technobaboo" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Sponsor This<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="searchBox_ZlJk"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/get-started/What-is-Stardust">Get Started</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/User-Guide/What-is-Stardust">User Guide</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/docs/dive-deeper/brief-overview">Dive deeper</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/dive-deeper/brief-overview">Brief Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/dive-deeper/deep-overview">Technical Overview</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/dive-deeper/make-clients">Making Clients</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/dive-deeper/terminology">Glossary</a></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Dive deeper</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Making Clients</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Making Clients</h1><p>A Stardust client is at its core an executable that connects to a stardust server instance at <code>$XDG_RUNTIME_DIR/stardust-[0-32]</code>, sends and receives messages according to the Stardust protocol.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="rust">Rust<a href="#rust" class="hash-link" aria-label="Direct link to Rust" title="Direct link to Rust"></a></h2><p>Stardust uses Rust due to its speed and reliability in build and runtime, so you will need to install cargo (preferably through <a href="https://rustup.rs/" target="_blank" rel="noopener noreferrer">rustup</a>). If you&#x27;re unsure how to use Rust then a great guide is at <a href="https://doc.rust-lang.org/book/" target="_blank" rel="noopener noreferrer">https://doc.rust-lang.org/book/</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="stardust-xr">stardust-xr<a href="#stardust-xr" class="hash-link" aria-label="Direct link to stardust-xr" title="Direct link to stardust-xr"></a></h2><p><code>stardust-xr</code> is a connecting library for servers and clients that deals with the lowest level of connecting to ensure basic compatibility is ensured. As a client developer you most likely won&#x27;t need it, but it&#x27;s good to know about it.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="fusion">Fusion<a href="#fusion" class="hash-link" aria-label="Direct link to Fusion" title="Direct link to Fusion"></a></h2><p><code>stardust-xr-fusion</code> is the high level library you&#x27;ll probably be using to create your clients. It features structs for all Stardust objects and trait-based + async systems for handling events from the server.</p><p>To get started, create a new Rust project using</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">cargo new</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>and include the <code>stardust-xr-fusion</code> dependency in your <code>cargo.toml</code>. Documentation will be available at <a href="https://docs.rs/crate/stardust-xr-fusion/latest" target="_blank" rel="noopener noreferrer">https://docs.rs/crate/stardust-xr-fusion/latest</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="molecules">Molecules<a href="#molecules" class="hash-link" aria-label="Direct link to Molecules" title="Direct link to Molecules"></a></h2><p><code>stardust-xr-molecules</code> is an even higher level widget library built on Fusion similar to <a href="https://github.com/microsoft/MixedRealityToolkit-Unity" target="_blank" rel="noopener noreferrer">MRTK</a> to get your clients up and running faster. Documentation will be available at <a href="https://docs.rs/crate/stardust-xr-molecules/latest" target="_blank" rel="noopener noreferrer">https://docs.rs/crate/stardust-xr-molecules/latest</a>.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/StardustXR/website/edit/main/docs/03-dive-deeper/03-make-clients.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/dive-deeper/deep-overview"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Technical Overview</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/dive-deeper/terminology"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Glossary</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#rust" class="table-of-contents__link toc-highlight">Rust</a></li><li><a href="#stardust-xr" class="table-of-contents__link toc-highlight">stardust-xr</a></li><li><a href="#fusion" class="table-of-contents__link toc-highlight">Fusion</a></li><li><a href="#molecules" class="table-of-contents__link toc-highlight">Molecules</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/get-started/setup-openxr">Getting Started</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://discord.gg/A9w7fKE" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://matrix.to/#/#stardustxr:matrix.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">Matrix<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://twitter.com/stardustxr" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/StardustXR" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stardust XR (GitHub)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/sponsors/technobaboo" target="_blank" rel="noopener noreferrer" class="footer__link-item">Sponsor This<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">Code</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/StardustXR/stardust-xr-server" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stardust XR (Server)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/StardustXR/stardust-xr" target="_blank" rel="noopener noreferrer" class="footer__link-item">stardust-xr (includes Fusion)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/StardustXR/flatland" target="_blank" rel="noopener noreferrer" class="footer__link-item">Flatland<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2025 Nova King</div></div></div></footer></div>
<script src="/assets/js/runtime~main.6124d2b9.js"></script>
<script src="/assets/js/main.0fbbb017.js"></script>
</body>
</html>