ScribeberryScribeberry Docs

SDK Installation

Install and configure the Scribeberry SDK for Node.js and browser environments.

The @scribeberry/sdk package is a universal TypeScript SDK that works in both Node.js and browser environments. It provides a type-safe client for the entire Scribeberry API surface.

Installation

npm install @scribeberry/sdk

Requirements

  • Node.js 18 or later (uses native fetch and WebSocket)
  • TypeScript 5.0+ recommended (full type declarations included)
  • Browsers: All modern browsers (Chrome, Firefox, Safari, Edge)

Basic Setup

scribeberry.ts
import { Scribeberry } from '@scribeberry/sdk';
 
// Server-side: use your full API key
const sb = new Scribeberry({
  apiKey: process.env.SCRIBEBERRY_API_KEY!,
  baseUrl: 'https://sandbox.api.scribeberry.com', // remove for production
});
 
export default sb;

Configuration Options

OptionTypeDefaultDescription
apiKeystringrequiredAPI key (sk_test_*, sk_live_*) or temp token (sb_rt_*)
baseUrlstringhttps://api.scribeberry.comAPI base URL
timeoutnumber30000Request timeout in milliseconds

Runtime Behavior

The SDK automatically adapts to its environment:

Node.js

  • Uses native fetch (Node 18+) with cross-fetch fallback
  • Uses the ws package for WebSocket connections
  • Full API access (REST + WebSocket)

Browser

  • Uses native fetch and WebSocket
  • Warns if a permanent API key (sk_*) is detected
  • createToken() is blocked (server-only operation)
  • Temp tokens (sb_rt_*) restrict access to WebSocket only

Package Exports

import {
  // Main client
  Scribeberry,
 
  // Error classes
  ScribeberryError,
  AuthenticationError,
  RateLimitError,
 
  // Realtime session
  RealtimeTranscriptionSession,
 
  // Types
  type ScribeberryConfig,
  type Template,
  type GenerateNoteResult,
  type RealtimeConfig,
  type TranscriptSegment,
  type RealtimeSessionResult,
  type RealtimeToken,
} from '@scribeberry/sdk';

Without the SDK (cURL / HTTP)

If you prefer to call the API directly:

# List templates
curl -H "Authorization: Bearer sk_test_..." \
  https://sandbox.api.scribeberry.com/api/v1/templates
 
# Generate a note
curl -X POST \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{"template_id": "...", "conversation_text": "..."}' \
  https://sandbox.api.scribeberry.com/api/v1/notes

All REST endpoints are documented in the API Reference.

On this page