Documentation Index
Fetch the complete documentation index at: https://mintlify.com/moqtail/moqtail/llms.txt
Use this file to discover all available pages before exploring further.
Package Installation
Moqtail is available as an npm package. Install it using your preferred package manager:Package Information
Package Name:
Current Version:
License: Apache-2.0
Homepage: https://moqtail.dev
Repository: github.com/moqtail/moqtail
moqtailCurrent Version:
0.9.0License: Apache-2.0
Homepage: https://moqtail.dev
Repository: github.com/moqtail/moqtail
Prerequisites
Before installing Moqtail, ensure your development environment meets these requirements:WebTransport Support
Your target browsers must support WebTransport. Check compatibility at caniuse.com/webtransport.Supported browsers:
- Chrome 97+
- Edge 97+
- Opera 83+
Import Paths
Moqtail provides multiple entry points for different parts of the library:Main Entry Point
Import everything from the main entry point:Subpath Imports
For more granular imports, use subpath exports:TypeScript Configuration
Moqtail is built with TypeScript and includes full type definitions. The package exports both ESM and CommonJS formats:package.json
Recommended tsconfig.json
For optimal TypeScript support:tsconfig.json
Build Tools Configuration
Vite
Moqtail works seamlessly with Vite:vite.config.ts
Webpack
For Webpack users:webpack.config.js
Verify Installation
Create a simple test file to verify your installation:test.ts
Setting Up a Local Relay (Optional)
For development, you may want to run a local MOQT relay server. The Moqtail repository includes a Rust-based relay:Install Rust
Install Rust from rustup.rs if not already installed.
The relay server is required for testing publisher and subscriber interactions. Without it, you can still import and work with Moqtail’s types and utilities.
Troubleshooting
Common Issues
Module not found error
Module not found error
Ensure you’ve run the install command and that
node_modules contains the moqtail directory.WebTransport is not defined
WebTransport is not defined
This error occurs when running in environments without WebTransport support (Node.js, older browsers).Solution: WebTransport is a browser-only API. Moqtail must run in a WebTransport-compatible browser or use a polyfill for testing.
TypeScript type errors
TypeScript type errors
Make sure your
tsconfig.json includes "lib": ["DOM", "ES2020"] to enable WebTransport types.Certificate trust issues
Certificate trust issues
For local development, you must trust the relay’s CA certificate. Follow the instructions in
apps/relay/cert/README.md.Next Steps
Quick Start
Build your first MOQT application
API Reference
Explore the complete API documentation