@staffetta/vue

Vue bindings for the staffetta speedtest client: a useSpeedtest composable with status, live log, start and cancel.
4
Install
npm install @staffetta/vue
Latest Version:0.3.1
Vue:3
License:MIT
Last Updated:Oct 12, 2026
Links: GitHub  ·  npm
Maintainer: j4ym

@staffetta/vue

Vue bindings for the staffetta speedtest client: a useSpeedtest composable with status, live log, start and cancel.

Install

npm install @staffetta/vue

Requires Vue ≥ 3.3.

Usage

<script setup lang="ts">
import {useSpeedtest} from '@staffetta/vue'

const {status, log, start, cancel} = useSpeedtest({baseUrl: 'https://api.example.com'})
</script>

<template>
  <div>
    <button v-if="status.kind === 'idle'" @click="start">Run speedtest</button>
    <button v-if="status.kind === 'running'" @click="cancel">Cancel ({{ status.phase }}…)</button>
    <pre v-if="status.kind === 'done'">{{ status.result }}</pre>
    <p v-if="status.kind === 'error'">Test failed: {{ status.reason }}</p>
    <ul><li v-for="(entry, idx) in log" :key="idx">{{ entry }}</li></ul>
  </div>
</template>

status and log are shallow refs; a test left running is aborted when the owning effect scope (usually the component) is disposed. Options may be a plain object, a ref or a getter — they are resolved when start() is called.

The composable accepts the same options as @staffetta/client's runSpeedtest (minus signal, onPhase and onSample, which the composable manages): baseUrl, paths, headers, fetch, config, thresholds. The server side needs the three protocol endpoints — see @staffetta/server.

Full documentation: github.com/staffetta/staffetta.

License

MIT

Related Packages

vueuse-temporals

Date related composables for atmosphere-ui

1,676 1
@alvarosabu/ui

UI Library for my personal projects

14,634 5
@orbisk/vue-use-media-recorder

🪝 Vue Composable around MediaRecorder API

12,546 2
@cyklang/vue3

Vue 3 composables for CYKLang

11,797
@teamnovu/kit-composables

A collection of composables

5,342 2

Version History

Version Released Vue License
0.3.1 >=3.3 MIT
0.3.0 >=3.3 MIT
0.2.0 >=3.3 MIT
0.1.0 >=3.3 MIT