Skip to main content
This page documents all TypeScript interfaces and types exported by speak-mintlify. These types are used throughout the codebase and can be imported when building custom integrations or extensions.

Voice Configuration

Voice

Represents a voice configuration for TTS generation.
id
string
required
Unique identifier for the voice (Fish Audio reference ID)
name
string
required
Human-readable name for the voice (e.g., “Sarah”, “John”)
url
string
Public URL to the generated audio file (set after upload to S3)
export interface Voice {
  id: string;
  name: string;
  url?: string;
}

Metadata Types

AudioMetadata

Stores metadata for each processed file, used for change detection and caching.
hash
string
required
SHA-256 hash of the file’s text content
lastUpdated
string
required
ISO 8601 timestamp of when the audio was last generated
voices
Voice[]
required
Array of voice configurations with generated audio URLs
export interface AudioMetadata {
  hash: string;
  lastUpdated: string;
  voices: Voice[];
}

MetadataFile

Structure of the .audio-metadata.json file that tracks all processed files.
export interface MetadataFile {
  [filePath: string]: AudioMetadata;
}
Example:
{
  "getting-started.mdx": {
    "hash": "a1b2c3d4...",
    "lastUpdated": "2024-03-15T10:30:00Z",
    "voices": [
      {
        "id": "voice-123",
        "name": "Sarah",
        "url": "https://cdn.example.com/audio/getting-started/voice-123.mp3"
      }
    ]
  }
}

Configuration Types

S3Config

Configuration for S3-compatible storage (AWS S3, Cloudflare R2, MinIO, etc.).
bucket
string
required
S3 bucket name
region
string
required
AWS region (or “auto” for Cloudflare R2)
endpoint
string
Custom endpoint URL for R2, MinIO, or other S3-compatible services
accessKeyId
string
required
S3 access key ID
secretAccessKey
string
required
S3 secret access key
publicUrl
string
required
CDN or public URL base for accessing uploaded files
pathPrefix
string
Optional path prefix for organizing files (e.g., “audio/“)
export interface S3Config {
  bucket: string;
  region: string;
  endpoint?: string;
  accessKeyId: string;
  secretAccessKey: string;
  publicUrl: string;
  pathPrefix?: string;
}

TTSConfig

Configuration for text-to-speech generation.
fishApiKey
string
required
Fish Audio API key for TTS generation
voiceIds
string[]
required
Array of Fish Audio voice reference IDs
voiceNames
string[]
Human-readable names corresponding to voice IDs
s3Config
S3Config
required
S3 storage configuration
componentImport
string
Path to audio player component (default: “/snippets/audio-transcript.jsx”)
componentName
string
Name of audio player component (default: “AudioTranscript”)
export interface TTSConfig {
  fishApiKey: string;
  voiceIds: string[];
  voiceNames?: string[];
  s3Config: S3Config;
  componentImport?: string;
  componentName?: string;
}

Fish Audio Types

FishAudioRequest

Request parameters for the Fish Audio API.
text
string
required
Text content to convert to speech
reference_id
string
required
Fish Audio voice reference ID
format
string
Audio format (default: “mp3”)
mp3_bitrate
number
MP3 bitrate in kbps
opus_bitrate
number
Opus bitrate in kbps
latency
'normal' | 'balanced'
Generation latency mode
streaming
boolean
Enable streaming response
export interface FishAudioRequest {
  text: string;
  reference_id: string;
  format?: string;
  mp3_bitrate?: number;
  opus_bitrate?: number;
  latency?: 'normal' | 'balanced';
  streaming?: boolean;
}

Processing Types

ProcessingResult

Result of processing a single MDX file.
file
string
required
Path to the processed file
success
boolean
required
Whether processing succeeded
voices
Voice[]
required
Array of voice configurations with audio URLs
error
string
Error message if processing failed
skipped
boolean
Whether the file was skipped (e.g., unchanged content)
reason
string
Reason for skipping the file
export interface ProcessingResult {
  file: string;
  success: boolean;
  voices: Voice[];
  error?: string;
  skipped?: boolean;
  reason?: string;
}

CLI Command Options

GenerateOptions

Command-line options for the generate command.
apiKey
string
Fish Audio API key (can also use FISH_API_KEY env var)
voices
string
Comma-separated voice IDs (can also use speaker-config.yaml)
voiceNames
string
Comma-separated voice names
s3Bucket
string
S3 bucket name (can also use S3_BUCKET env var)
s3Region
string
S3 region
s3Endpoint
string
Custom S3 endpoint
s3AccessKeyId
string
S3 access key ID
s3SecretAccessKey
string
S3 secret access key
s3PublicUrl
string
Public URL for accessing files
s3PathPrefix
string
Path prefix for organizing files
componentImport
string
Component import path
componentName
string
Component name
pattern
string
Glob pattern for MDX files
dryRun
boolean
Preview changes without making them
verbose
boolean
Enable verbose logging
export interface GenerateOptions {
  apiKey?: string;
  voices?: string;
  voiceNames?: string;
  s3Bucket?: string;
  s3Region?: string;
  s3Endpoint?: string;
  s3AccessKeyId?: string;
  s3SecretAccessKey?: string;
  s3PublicUrl?: string;
  s3PathPrefix?: string;
  componentImport?: string;
  componentName?: string;
  pattern?: string;
  dryRun?: boolean;
  verbose?: boolean;
}

CleanupOptions

Command-line options for the cleanup command.
s3Bucket
string
S3 bucket name
s3Region
string
S3 region
s3Endpoint
string
Custom S3 endpoint
s3AccessKeyId
string
S3 access key ID
s3SecretAccessKey
string
S3 secret access key
s3PublicUrl
string
Public URL for accessing files
s3PathPrefix
string
Path prefix for organizing files
componentName
string
Component name to remove
pattern
string
Glob pattern for MDX files
dryRun
boolean
Preview changes without making them
verbose
boolean
Enable verbose logging
export interface CleanupOptions {
  s3Bucket?: string;
  s3Region?: string;
  s3Endpoint?: string;
  s3AccessKeyId?: string;
  s3SecretAccessKey?: string;
  s3PublicUrl?: string;
  s3PathPrefix?: string;
  componentName?: string;
  pattern?: string;
  dryRun?: boolean;
  verbose?: boolean;
}

Importing Types

All types are exported from the main types module:
import type {
  Voice,
  AudioMetadata,
  MetadataFile,
  S3Config,
  TTSConfig,
  FishAudioRequest,
  ProcessingResult,
  GenerateOptions,
  CleanupOptions,
} from 'speak-mintlify/types';

Build docs developers (and LLMs) love