vocalstack

payload plugin

by vocalstack
AI content generation
v3
^3.0.0
MIT

Overview

Summary generated from the README

Adds a Transcribe button to audio upload collections and saves the transcript and timed sentences on the document. Transcripts can be translated into up to 10 languages and read aloud with synthetic or cloned voices, and the MP3s are kept in your own storage. Requires a VocalStack API key and Payload 3, and adds fields and a global that need an importmap and a migration on SQL databases.

Features

  • Transcribe button on audio uploads with live progress, stop control and bulk transcription from list views
  • Editable transcript plus timed sentences with speaker labels saved on the document
  • Translate transcripts into up to 10 languages and generate spoken readings stored in an upload collection
  • Speaker voice cloning from recordings or uploaded samples, with a synthetic or cloned voice toggle
  • Optional listener endpoints so visitors can request a transcript in their own language
  • Send metadata, tags and external IDs to VocalStack from document fields

Use cases

  • Add searchable transcripts with timestamps to podcast or sermon audio libraries
  • Offer translated transcripts and read-aloud audio for multilingual listeners
  • Read content aloud in a speaker's cloned voice for a consenting speaker

From the author

VocalStack for Payload CMS: transcribe audio, translate it into other languages and read it aloud, kept in your own database and storage.

Installation

npm i @vocalstack/payload

0

Stars

0

Forks

0

Open Issues

3 days ago

Last Updated

874

Weekly Downloads

v0.12.0

npm Version

425.7 KB

Unpacked Size

1

Dependencies

GitHub stars

00 since Oct 11

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260
Nov 28, 20260
Nov 27, 20260
Nov 26, 20260
Nov 25, 20260
Nov 24, 20260
Nov 23, 20260
Nov 22, 20260
Nov 21, 20260
Nov 20, 20260
Nov 19, 20260
Nov 18, 20260
Nov 17, 20260
Nov 16, 20260
Nov 15, 20260
Nov 14, 20260
Nov 13, 20260
Nov 12, 20260
Nov 11, 20260
Nov 10, 20260
Nov 9, 20260
Nov 8, 20260
Nov 7, 20260
Nov 6, 20260
Nov 5, 20260
Nov 4, 20260
Nov 3, 20260
Nov 2, 20260
Nov 1, 20260
Oct 31, 20260
Oct 30, 20260
Oct 29, 20260
Oct 28, 20260
Oct 27, 20260
Oct 26, 20260
Oct 25, 20260
Oct 24, 20260
Oct 23, 20260
Oct 22, 20260
Oct 21, 20260
Oct 20, 20260
Oct 19, 20260
Oct 18, 20260
Oct 17, 20260
Oct 16, 20260
Oct 15, 20260
Oct 14, 20260
Oct 13, 20260
Oct 12, 20260
Oct 11, 20260
npm weekly downloads

836+836 since Oct 22

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 2026836
Dec 4, 2026786
Dec 3, 2026785
Dec 2, 2026603
Dec 1, 2026591
Nov 30, 2026541
Nov 29, 2026513
Nov 28, 2026486
Nov 27, 2026187
Nov 26, 2026164
Nov 25, 202657
Nov 24, 202670
Nov 23, 202693
Nov 22, 2026285
Nov 21, 2026606
Nov 20, 2026625
Nov 19, 2026807
Nov 18, 2026964
Nov 17, 20261,152
Nov 16, 20261,291
Nov 15, 20261,293
Nov 14, 20261,142
Nov 13, 20261,120
Nov 12, 2026938
Nov 11, 2026756
Nov 10, 2026562
Nov 9, 2026403
Nov 8, 2026201
Nov 7, 202630
Nov 6, 202633
Nov 5, 202636
Nov 4, 202633
Nov 3, 202647
Nov 2, 202652
Nov 1, 202672
Oct 31, 2026286
Oct 30, 2026455
Oct 29, 2026451
Oct 28, 2026451
Oct 27, 2026427
Oct 26, 2026416
Oct 25, 2026394
Oct 24, 2026174
Oct 23, 20260
Oct 22, 20260

Each point is npm's rolling 7-day download count.

Health Score

76/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1423030201-root.svg)](https://payloaddirectory.dev/plugins/1423030201-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1423030201-root"><img src="https://payloaddirectory.dev/badge/1423030201-root.svg" alt="Payload Directory"></a>
Updated Dec 2, 2026Created Oct 17, 2026Published Dec 2, 2026

README

@vocalstack/payload

VocalStack for Payload CMS 3: a Transcribe button on every audio upload. The transcript is saved on the document as text plus timed sentences.

Read more about the VocalStack transcription plugin for Payload CMS on the VocalStack website.

Install

pnpm add @vocalstack/payload
// payload.config.ts
import { vocalstackPlugin } from '@vocalstack/payload'

export default buildConfig({
  plugins: [
    vocalstackPlugin({
      // Optional. Without it, connect from Admin → Settings → VocalStack.
      apiKey: process.env.VOCALSTACK_API_KEY,
    }),
  ],
})

Then run payload generate:importmap. The plugin adds fields to the targeted collections and a vocalstack global, so with Postgres also run payload migrate:create.

What it adds

  • Every upload collection that accepts audio (audio/*, a wildcard, or no restriction), or the ones in collections, gets:
    • a sidebar Transcribe button, shown on audio/* documents only. It shows progress and survives a reload mid-job, and Stop ends a job you no longer want: the document goes back to how it was (an earlier transcript stays), and VocalStack keeps what it transcribed before the stop.
    • a vocalstack group:
      • transcript: text you can edit; paragraphs break on a speaker change or a pause.
      • sentences: [{ start, end, speaker, text }] in seconds.
      • status, language, error, transcriptionId and transcribedAt (and recordingId, which documents transcribed before 0.9.0 keep; everything is read by transcriptionId).
    • POST /api/{collection}/:id/vocalstack/transcribe, POST …/vocalstack/stop, GET …/vocalstack/status and GET …/vocalstack/stream (live progress as Server-Sent Events).
  • Translations and readings, under every finished transcript: translate it into up to 10 of VocalStack's 100 languages (VocalStack's limit per transcription), and have each translation read aloud where VocalStack has a voice for it. VocalStack picks the voices; a toggle on each transcript chooses between synthetic voices and the speakers' own cloned voices (where they have one, made with their permission), saved as voices. One click in the admin does both; the server carries on until it is done, with no one watching. Saved in the vocalstack group as:
    • translations: { [lang]: { translatedAt, sentences, pending?, error?, requestedAt? } }, the transcript's sentences (same ids and times) translated. pending while the server is still translating it.
    • speech: { [lang]: { voice, cast, readIn, state, error, durationS, requestedAt, renderedAt, sentences, audio } }. state is translating (waiting for its translation), queued, running, failed or sealed; once sealed, sentences are the translation in the reading's own timing, with words, for a read-along player, and audio is the MP3 kept in your storage.
    • POST …/vocalstack/voices { voices: 'synthetic' | 'cloned' }, POST …/vocalstack/request { langs, speak? } (translate, and read aloud unless speak: false; carried on by the server), POST …/vocalstack/translate { langs } (one step; answers more: true when it stopped for time), DELETE …/vocalstack/translate?lang=, POST …/vocalstack/speak { langs }, GET …/vocalstack/speak, and the public GET …/vocalstack/audio?lang=, which redirects to the reading's MP3 (or, with no lang or the spoken one, the transcribed audio) for anyone who may read the document.
  • Languages for listeners (opt in with listeners): visitors pick any language VocalStack offers, and it is made for them and kept for everyone after. GET /api/vocalstack/languages is public, POST …/vocalstack/listen { lang } asks for a language and GET …/vocalstack/listen?lang= says where it stands; see below.
  • Speakers (opt in with speakers): documents of a collection of people get a sidebar panel that saves that person as a VocalStack speaker and clones their voice, from a minute of a recording they speak in or from an uploaded sample, with their permission. Kept in a hidden vocalstackSpeaker group (speakerId, cloneId, state of the voice: none/training/ready/failed, progress, error, sampleS, consentAt, createdAt), with GET/POST/DELETE /api/{collection}/:id/vocalstack/speaker, …/speaker/sources and …/speaker/preview.
  • Settings → VocalStack (a global), where an editor connects a VocalStack workspace. It shows the workspace the site works in, with its name and icon, and Change picks another. The key is stored server-side and is unreadable over the REST and GraphQL APIs.

Options

OptionDefault
apiKeynoneA vs_key_… key with Read and Write. It wins over a key connected in the admin.
collectionsevery upload collection that accepts audioWhich upload collections get the button.
audioFieldsnoneAudio that isn't an upload document; see below.
spokenLanguageauto-detectA Whisper language code (en, ro, …).
fileURLthe doc's url, made absolute({ doc, collection, req }) => string: the address VocalStack fetches. Point it at your bucket's public URL to skip the Payload file proxy.
accesssigned-in users who can update the docExtra check for transcribing, translating, speakers, voices and the admin lookups, and for changing the connection.
oneClickConnectfalseShow Connect VocalStack (see below).
updateChecktrueSay in the admin when a newer version is on npm; see below. false makes no outbound call.
apiURL / dashboardURLhttps://api.vocalstack.com / https://app.vocalstack.com
enabledtruefalse keeps the schema but removes the button and the endpoints.
speakersnoneCollections of people saved as VocalStack speakers, each with a cloned voice; see below. (voices, its name in 0.5, still works.)
readings{ slug: 'vocalstack-readings' }The upload collection finished readings are kept in, added by the plugin; overrides: (collection) => collection adjusts it. false streams readings from VocalStack instead. See below for bringing your own.
listenersofftrue, or { languages?, speak?, access?, perHour? }: let visitors ask for a transcript in their language; see below.
metadatanone({ collection, doc, field, row, req }) => MetadataPatch: VocalStack metadata for each transcription, from its document; see below.
tagsnone({ collection, doc, field, row, req }) => string[]: VocalStack tags for each transcription, by name; see below.
externalId<collection>:<id> (<collection>:<id>:<row id> for an audio row)(args) => string: the transcription's externalId, unique in the workspace. false sends none.
externalURLnone(args) => string: the transcription's externalUrl, e.g. the document's public page.
metadataFieldsnone[{ key, label, type, public?, options? }]: workspace fields made (or set public) before metadata is first written; see below.
voiceModethe transcript's toggle({ collection, doc, req, row }) => 'synthetic' | 'cloned' | undefined: the site decides how transcripts are read aloud, and the toggle is hidden. See below.

Updates

The plugin is part of your site's code, so it can't update itself: a new version means changing package.json, rebuilding and deploying, and sometimes a migration. It does tell you when one is out. The server asks npm for the newest @vocalstack/payload at most every 6 hours (GET /api/vocalstack/version, signed-in users), and while a newer one is out the admin nav shows a notice linking to Settings → VocalStack, which shows both versions, the release notes and the steps. VERSION (from @vocalstack/payload) is the installed one.

To have updates proposed for you, let Renovate or Dependabot open a pull request for each release:

// renovate.json
{ "extends": ["config:recommended"], "packageRules": [{ "matchPackageNames": ["@vocalstack/payload"], "labels": ["vocalstack"] }] }

After updating, run payload generate:importmap, and with Postgres or SQLite payload migrate:create.

Audio that isn't an upload

Imported content often points at files by name or link instead of upload documents. audioFields gives each row of an array field its own button and vocalstack transcript:

vocalstackPlugin({
  audioFields: [
    {
      collection: 'episodes',
      field: 'attachments', // a top-level array (tabs, rows and collapsibles are looked through)
      condition: (row) => row.type === 'file',
      audioURL: ({ row }) => (row.filename ? `https://cdn.example.com/episodes/${encodeURIComponent(String(row.filename))}` : undefined),
    },
  ],
})

Rows are addressed by their id: POST /api/episodes/:id/vocalstack/transcribe?field=attachments&row=<row id>. A new row needs saving first.

Transcribing from the list

Select documents in a list (an audio upload collection, or a collection with audioFields) and a Transcribe button with the VocalStack mark shows above the table. After a confirmation it starts a transcription for every audio file of the selection (each audio row of each document), 25 documents per request; "Select all" across pages takes every document the list's filters match. Files already transcribed or in progress are skipped, and if VocalStack refuses a start every other start would get too (no credit, a cap, the key), nothing more is started and the reason is shown once. bulkTranscribe: false turns it off.

While the list is open it asks every 5 s (POST /api/<collection>/vocalstack/settle) how running jobs stand, saves the ones that finished on their documents and refreshes the list, so nobody has to open each document. The answer's jobs ({ id, row, phase, progress }, phase queued, fetching, transcribing or finalizing) is also there for a list cell: useTranscriptionProgress(collection, id) from @vocalstack/payload/client returns { phase, progress } for a document while it runs.

'use client'
import { useTranscriptionProgress } from '@vocalstack/payload/client'

export const TranscribedCell = ({ cellData, rowData }) => {
  const live = useTranscriptionProgress('sermons', rowData?.id)
  if (live) return <span>{live.phase === 'transcribing' ? `${live.progress}%` : live.phase}</span>
  return <span>{cellData ? '✓' : '–'}</span>
}

Every call to VocalStack says User-Agent: VocalStack-Payload/<version>, so its transcriptions are recorded as origin payload.

Metadata and tags

Every transcription the plugin makes can carry VocalStack metadata and tags taken from its document, so it can be found, filtered (GET /v1/transcriptions?metadata[preacher]=John Smith, ?tag=) and shown with its details in VocalStack and on its share links.

vocalstackPlugin({
  // VocalStack's system fields (recordedAt, location, event, description, externalId, externalUrl, episode,
  // license) and the workspace's own under `custom`. Only the keys given change; null clears one.
  metadata: async ({ doc, req }) => ({
    recordedAt: String(doc.date).slice(0, 10), // YYYY-MM-DD, or an RFC 3339 time, or a Date
    description: (doc.description as string) || null,
    custom: { speaker: doc.speakerName as string, episodeKind: 'interview' },
  }),
  tags: ({ doc }) => [doc.category as string, 'Podcast'],
  externalURL: ({ doc }) => `https://example.com/episodes/${doc.slug}`,
  // Optional: fields with a label, a type and public (shown to listeners) set up front.
  metadataFields: [{ key: 'speaker', label: 'Speaker', type: 'choice', public: true }],
})
  • When it is sent: with the transcription when it is made (the Transcribe button, the list, a file sent again after its link failed), and after every save of the document that holds it (after the response, in the background), with what the functions answer then. The plugin keeps what it last sent in vocalstack.metadataSync ({ transcriptionId, hash, tags, at, error }, no key or secret), so a save that changes nothing sends nothing, and the plugin's own saves (progress, transcripts, readings) send nothing either.
  • Metadata never stops a transcription: a value VocalStack refuses (a type that does not fit its field, a key that may not make fields) makes the transcription without metadata; the reason is kept in metadataSync.error and the next save tries again.
  • externalId is on by default and unique in the workspace. Transcribing a document again takes it off the earlier transcription first. If another transcription holds it, the new one is made without metadata and metadataSync.error says so.
  • Custom fields a key has no field for yet are made by VocalStack on first use: text for a string, number, boolean, multi_choice for a list, labelled from the key ("sermonSeries" → "Sermon series") and private. metadataFields makes them up front instead, with your label, type (text, long_text, number, boolean, date, datetime, link, choice, multi_choice) and public. Existing fields keep their type; their label and public are set as given (once per server start).
  • Tags are made in the workspace when missing (up to 200 a workspace, names 1 to 40 characters). A tag the plugin put on and no longer lists is taken off; tags someone added in VocalStack stay.
  • A key left out (or undefined) is left as it is in VocalStack; null clears it (on a new transcription null is the same as leaving it out).
  • metadata answering undefined sends nothing for that transcription: no metadata, no externalId, no tags. Every function is called for every transcription of the plugin's collections, upload documents (row and field unset) and audio rows alike, so guard with collection: metadata: ({ collection, doc }) => (collection === 'sermons' ? {…} : undefined). Answering {} sends only the defaults.

Documents transcribed before the mapping existed, or before you changed it, get theirs on their next save, or all at once:

// scripts/vocalstack-sync.ts: `payload run scripts/vocalstack-sync.ts`
import { getPayload } from 'payload'
import config from '@payload-config'
import { syncMetadata } from '@vocalstack/payload'

const payload = await getPayload({ config })
const result = await syncMetadata(payload, { onProgress: (r, c) => console.log(c, r.synced, r.unchanged, r.failed.length) })
console.log(result) // { synced, unchanged, failed: [{ collection, id, row?, error }] }
process.exit(0)

syncMetadata(payload, { collections?, force? }) goes through every transcribed document of the plugin's collections and sends only what changed (force: true sends everything again). POST /api/<collection>/vocalstack/sync-metadata { ids, force? } does the same for up to 25 documents, for anyone who may update them.

After updating to 0.12, run payload migrate:create (Postgres, SQLite): the vocalstack group has a new JSON column, metadataSync.

Speakers

import { vocalstackPlugin } from '@vocalstack/payload'

vocalstackPlugin({
  speakers: [
    {
      collection: 'speakers',
      // Transcriptions this speaker is in, offered as the sample to clone from.
      transcriptions: async ({ doc, req }) => {
        const { docs } = await req.payload.find({ collection: 'episodes', where: { speaker: { equals: doc.id } }, req })
        return docs.flatMap((e) => (e.vocalstack?.transcriptionId ? [{ label: e.title, sentences: e.vocalstack.sentences, transcriptionId: e.vocalstack.transcriptionId }] : []))
      },
    },
  ],
})

A sample from a transcription can only come from the ones transcriptions returns for that document: cloning, and hearing a stretch first (GET /:id/vocalstack/speaker/clip?transcription=), refuse any other. Each source needs its transcriptionId. Before 0.9.0 this option was called recordings and keyed by recordingId; recordings still works, but sources that carry only a recordingId are left out, because VocalStack no longer looks transcripts up by recording.

Cloning needs at least 30 seconds of the person speaking alone (a minute is better, at most two), and the editor confirms they have the person's permission. From a recording, the editor clicks where the stretch starts and hears it before cloning; the plugin takes it from VocalStack. An uploaded sample is sent through your server, so on hosts that cap request bodies (Vercel: 4.5 MB) keep it to a minute or two of MP3 or M4A. Training takes a few minutes; the panel follows it. Deleting the speaker deletes them and their voice in VocalStack too. When VocalStack transcribes a new recording, it checks who speaks against your saved speakers first.

A cloned voice only ever reads words its own speaker said. With cloned (from the toggle, or from voiceMode once a person has a voice), each speaker VocalStack has matched to a clone is read in it: the speaker it was made from, or one VocalStack recognised as the same person when it transcribed the recording. Everyone else is read in a stock voice. VocalStack doesn't always recognise a speaker, and recordings transcribed before the voice existed are not matched, so a reading reports what it got as speech[lang].readIn: cloned, synthetic, or mixed.

voiceMode: async ({ doc, req }) => {
  const speaker = await req.payload.findByID({ collection: 'speakers', id: doc.speaker, depth: 0, req })
  return speakerData(speaker).state === 'ready' ? 'cloned' : 'synthetic'
}

speakerData(doc) (from @vocalstack/payload) reads the vocalstackSpeaker group, or the vocalstackVoice group of a document 0.5 saved and nobody has opened since.

Upgrading from 0.5

0.6 follows VocalStack's rename of saved voices to speakers (/v1/speakers; a speaker's voice is only the sound, its clone). It talks to VocalStack before and after that change: it calls /v1/speakers first and falls back to /v1/voices on a 404, so nothing needs doing on the day the API changes.

  • Option: voices is now speakers. voices is still read when speakers is not set. Types: SpeakerCollectionConfig, SpeakerSource, SpeakerFieldData, CloneState (the old names are deprecated aliases).
  • Fields: speaker collections get a new hidden group, vocalstackSpeaker (speakerId, cloneId, and the fields vocalstackVoice had). The vocalstackVoice group stays in the schema and is kept in step (voiceId is the clone's id) for one more minor version, so code reading it keeps working; move it to speakerData(doc) or vocalstackSpeaker. The sidebar field is now vocalstackSpeakerPanel (a UI field, nothing stored).
  • Data: nothing is lost. A document still holding only vocalstackVoice is read through it and copied into vocalstackSpeaker the first time its panel opens. To copy them all at once, call migrateSpeakerFields({ collection, payload, req }) from a migration:
// migrations/20261107_vocalstack_speakers.ts, after `payload migrate:create`
import { migrateSpeakerFields } from '@vocalstack/payload'
import type { MigrateUpArgs } from '@payloadcms/db-postgres'

export async function up({ payload, req }: MigrateUpArgs) {
  await migrateSpeakerFields({ collection: 'speakers', payload, req })
}
  • Run payload generate:importmap (the panel's component is now SpeakerField), and with Postgres or SQLite payload migrate:create for the new columns (the old ones are kept).
  • Endpoints: /:id/vocalstack/speaker… replaces /:id/vocalstack/voice…; the old paths still answer. Answers carry vocalstackSpeaker (and vocalstackVoice as before).

Translations and readings

Translating an hour-long transcript takes a few minutes. The server does it in steps of about 20 seconds, each saved as it goes, and carries on after each response whenever the document is read or its progress is asked for, so an editor can close the page (and a translation started by a listener finishes on its own). A transcription has at most 10 languages besides its spoken one; asking for an 11th answers 409 language_limit_reached. A reading is rendered by VocalStack (a few languages at a time per transcription) and saved once ready. The reading keeps each sentence where it was said, unless the one before still runs, so a player can follow along with speech[lang].sentences (timedTokens() works on them as on the transcript).

Everything is asked for once and kept. The transcript (text, sentences, word times) and each translation are saved on the document. Translating again only asks for sentences that have none, and reads ones VocalStack already translated back from /transcript?lang= rather than translating them again. A finished reading's MP3 is downloaded once and saved as an upload in the vocalstack-readings collection (option readings), so listeners are served from your storage: GET …/vocalstack/audio redirects to that file, or for the spoken language to your own audio file, and only falls back to VocalStack while a reading isn't kept yet. Point your storage adapter at the readings collection, e.g. s3Storage({ collections: { 'vocalstack-readings': { prefix: 'readings', disablePayloadAccessControl: true } } }) for direct public URLs.

The readings collection. By default the plugin adds vocalstack-readings: public read, and create, update and delete for signed-in users. Change it with readings: { overrides: (collection) => ({ ...collection, access: { ... } }) }, or define an upload collection with that slug (or readings.slug) yourself; the plugin then uses yours as it is. It needs to accept audio/mpeg and to have text fields lang, transcriptionId and voice (readings kept before 0.9.0 are found by a recordingId field, where the collection has one).

Languages for listeners

With listeners: true, anyone who may read a document can ask for its transcript in another language, from your own site:

// What can be asked for: { languages: [{ code, name, native, translation, voice }], translation, voice }
await fetch('/api/vocalstack/languages')
// Ask (on an array row add ?field=&row= as for transcribing). Asked already: answers where it stands.
await fetch(`/api/sermons/${id}/vocalstack/listen`, { method: 'POST', body: JSON.stringify({ lang: 'pl' }) })
// Follow it: { state: 'translating' | 'ready' | 'failed' | 'none', done, total, voice, speech: { state, audio }, version }
await fetch(`/api/sermons/${id}/vocalstack/listen?lang=pl`)

The translation is saved on the document, and where VocalStack can read the language aloud, the reading follows (in the voice VocalStack picks) and its MP3 is kept in the readings collection. Once speech.state is ready, speech.audio is that file in your own storage. Nothing is made twice: a language someone already asked for is answered from the document. Visitors can only ask for languages VocalStack offers (narrowed by languages), within the 10-language limit, and each one (by IP address) can ask for perHour new languages an hour (10 by default); access: ({ lang, req }) => boolean adds your own check. The language list keeps working when VocalStack can't be reached: the plugin falls back to its last answer, or to the list it ships with.

Your site keeps working without VocalStack. Everything a listener reads or hears (the transcript, every translation, every reading's MP3 and word timings) is served from your database and storage. VocalStack is only needed to make something new.

When VocalStack does not answer (an outage, an upgrade), the endpoints say VocalStack is unavailable, try again shortly. instead of waiting.

How the audio reaches VocalStack. If the file has a public address, VocalStack fetches it (POST /v1/transcriptions { url }). Otherwise (localhost, a private network) the plugin uploads the bytes. If VocalStack's fetch of a public address fails because of the link (its server refuses VocalStack, as addresses signed for one viewer, IP address or region do; it answers with nothing; or it cannot be reached or found from VocalStack: job errorCode link_refused, link_empty, link_unreachable or link_not_found), the plugin reads the file itself and uploads the bytes in a new job, once. The job's own reason is shown only when that fails too. Either way the job runs on VocalStack, and the admin polls every 3 s. The connected workspace is billed per second, with a 5-minute minimum per transcription.

The workspace

A VocalStack API key belongs to one workspace: what the site transcribes is kept in that workspace and uses its credit. Settings → VocalStack shows it under Workspace, with its name and its mark as the VocalStack Dashboard draws it (its own icon; a person for the personal workspace; otherwise its initials on its colour). The name and icon are read from GET /v1/me whenever the connection is checked (at most once a minute), so a rename or a new icon in VocalStack shows up here, and a pasted key or a key from the plugin config shows its workspace too. GET /api/vocalstack/connection answers { connected, source, account, workspace: { id, name, personal, iconUrl } }, with iconUrl an absolute link the browser can load as it is.

A key never moves to another workspace. With oneClickConnect, Change next to the workspace runs the connect flow again: pick another workspace on VocalStack's consent screen and click Authenticate, and the site swaps to the new key. Cancelling, in VocalStack or with Cancel in the admin, leaves the connection as it was. Connecting again makes a new key; the old one keeps working until it is revoked in VocalStack under Developers → API keys. Without oneClickConnect, disconnect and paste a key made in the other workspace. A key from the plugin config is changed there.

Transcripts stay in the workspace that made them. After a change, the transcripts, translations and readings already saved on your documents are still there and still served, but asking VocalStack for more of one made in the old workspace (another language, a reading, a speaker's sample) answers This transcript is not in the connected VocalStack workspace…; transcribe the file again to work with it in the new workspace. A transcription that was still running when the workspace changed ends as failed with the same sentence.

One-click connect (protocol)

The alternative to pasting a key: Connect VocalStack opens the dashboard in a new tab, the person chooses a workspace and clicks Authenticate, and the tab closes. Change runs the same flow while connected; the stored key is replaced only once the new one has been issued. While connected, the link also carries workspace=<id> (the workspace of the key in use), so the consent screen starts on that workspace; it is left out when the workspace cannot be told. This is OAuth 2.0 authorization code + PKCE (RFC 7636) with an API key as the access token. There is no client registration: the consent screen shows the redirect_uri host instead.

CMS admin                           CMS server                         app.vocalstack.com / api.vocalstack.com
──────────                          ──────────                         ───────────────────────────────────────
click Connect ── POST /api/vocalstack/connect ─▶ state, verifier (10 min)
◀──────────── { url } ──────────────
new tab ─▶ GET app/connect?response_type=code&client_name=…&redirect_uri=…&state=…
                                    &code_challenge=…&code_challenge_method=S256&scope=read write
           (sign in if needed; pick the workspace; "example.com wants to transcribe with VocalStack")
           click Authenticate ─▶ API stores a single-use grant (code hash, challenge, redirect, scopes, principal; 2 min)
           ◀── 302 redirect_uri?code=…&state=…
tab ─────── GET /api/vocalstack/callback ─▶ check state (+ admin session)
                                    POST api/v1/connect/token (form) ─▶ grant_type=authorization_code, code,
                                                                        code_verifier, redirect_uri
                                                                        verify, burn the code, create the key
                                    ◀── { access_token: "vs_key_…", token_type: "api_key", key_id, account: { name },
                                          workspace: { id, name, personal, iconUrl } }
                                    stores the key (never sent to a browser)
tab: "Connected", BroadcastChannel('vocalstack') ─▶ admin refreshes; tab closes

Cancel redirects with ?error=access_denied&state=…; DELETE /api/vocalstack/connect drops a pending connect from the admin side. The key appears in the dashboard's API keys list as example.com (Payload CMS), where it can be revoked.

Releasing

Bump version in package.json and push to main. The publish workflow runs the tests (pnpm test: a build, then node --test over test/; then e2e/run.sh, the plugin in a basic Payload project in a browser, on a fake VocalStack: see e2e/README.md), publishes that version to npm (trusted publishing, with provenance), tags v<version> and creates the GitHub release. A version npm already has is skipped. A prerelease (0.5.0-beta.1) goes to the next dist-tag. Nobody publishes from a laptop.

The test workflow runs the same two on every push and pull request, and on main runs the basic project against the real VocalStack too when the repository has a VOCALSTACK_API_KEY secret.

Similar plugins