npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gladiaio/sdk

v1.0.4

Published

Gladia JavaScript/TypeScript SDK

Readme

Gladia JavaScript SDK

A TypeScript/JavaScript SDK for the Gladia API.

Requirements

For non-browser environment, you need either Node.js 20+ or Bun .

Installation

npm install @gladiaio/sdk

If you are using Node.js < 22, you also need to install the ws package:

npm install ws

Usage

Import GladiaClient and create an instance.

Provide an API key with apiKey or the GLADIA_API_KEY environment variable. Get your API key here in under a minute.

You can also set GLADIA_API_URL and GLADIA_REGION (eu-west / us-west).

Node.js / Browser (ESM)

import { GladiaClient } from '@gladiaio/sdk'

const gladiaClient = new GladiaClient({
  apiKey: 'your-api-key',
})

Node.js (CommonJS)

const { GladiaClient } = require('@gladiaio/sdk')

const gladiaClient = new GladiaClient({
  apiKey: 'your-api-key',
})

Browser (script tag)

<script src="https://unpkg.com/@gladiaio/sdk"></script>

<script>
  const gladiaClient = new Gladia.GladiaClient({
    apiKey: 'your-api-key',
  })
</script>

Pre-recorded transcription

transcribe() accepts a file path (Node), http(s) URL, File, or Blob. It uploads when needed, then polls until the job completes.

import { GladiaClient } from '@gladiaio/sdk'
import 'dotenv/config'

const gladiaClient = new GladiaClient()
const audioPath = '../data/online-meeting-example.mp4'

const result = await gladiaClient.preRecorded().transcribe(audioPath, {
  language_config: { languages: ['en'] },
})

console.log(result.result?.transcription?.full_transcript ?? '')

See all supported languages here !

Pass the options argument to enable features from Audio intelligence such as diarization, translation, PII redaction, and much more.

Async pre-recorded

If your runtime has no top-level await, wrap calls in an async function:

async function main() {
  const gladiaClient = new GladiaClient()
  const result = await gladiaClient.preRecorded().transcribe('./audio.mp3')
  console.log(result.result?.transcription?.full_transcript ?? '')
}

main().catch(console.error)

Live transcription

const liveSession = gladiaClient.liveV2().startSession({
  model: 'solaria-1',
  encoding: 'wav/pcm',
  sample_rate: 16000,
  bit_depth: 16,
  channels: 1,
  language_config: {
    languages: ['en'],
  },
  messages_config: {
    receive_partial_transcripts: true,
  },
})

liveSession.on('message', (message) => {
  if (message.type === 'transcript') {
    console.log(`${message.data.is_final ? 'F' : 'P'} | ${message.data.utterance.text.trim()}`)
  }
})

liveSession.once('started', () => {
  console.log(`Session ${liveSession.sessionId} started`)
})

liveSession.on('error', (err) => {
  console.error('An error occurred during live session:', err)
})

liveSession.once('ended', () => {
  console.log(`Session ${liveSession.sessionId} ended`)
})

liveSession.sendAudio(/* <audio_chunk> */)
liveSession.stopRecording()

See all the supported languages here !

Pass the options argument to enable features from Audio intelligence such as diarization, translation, PII redaction, and much more.

Waiting for the session to finish

To await shutdown after stopRecording(), wait on the ended event:

import { GladiaClient } from '@gladiaio/sdk'

async function runLive() {
  const gladiaClient = new GladiaClient({ apiKey: 'your-api-key' })
  const liveSession = gladiaClient.liveV2().startSession({
    language_config: { languages: ['en'] },
  })

  const ended = new Promise<void>((resolve) => {
    liveSession.once('ended', () => resolve())
  })

  liveSession.stopRecording()
  await ended
}

runLive().catch(console.error)

When you need the session id as soon as the backend has created the session:

const sessionId = await liveSession.getSessionId()

Documentation

License

MIT