DocumentationAPI ReferenceReact SDKRelease Notes
ScaleAI

Getting Started

OverviewInstallationQuick Start

Core

Provider & Setup

Hooks

AgentsOutbound CallsCall HistoryPhone NumbersIntegration CredentialsWebhooksKnowledge BasesFunction ToolsFunction Logs

Realtime

Realtime

UI

Components

Reference

TypesUtilities
Go to platform

Types

Domain models, request parameters, and common response types.

The SDK exposes its public TypeScript models from the /types entry point. It is type-only, so importing it adds no runtime code. Import only the types used by your app:

import type {
  CallHistory,
  ListCallHistoryParams,
  ListCallHistoryResponse,
} from "@scalereal/sr-voice-engine-react-sdk/types";

Shared types

  • PaginatedQueryParams: optional 1-based page and size values.
  • PaginatedResponse<TItem>: items, total, page, size, and pages.
  • SortByParam<T>: a sort field with an optional - prefix for descending order.
  • SortDirection: asc or desc.

Call sessions and transcripts

Call-session types include CallHistory, CallDetailsResponse, CallRecordingUrlResponse, ListCallHistoryParams, and their response types. CallStatus covers initiated, ringing, in_progress, completed, failed, missed, and ongoing; CallDirection is inbound or outbound.

Both CallHistory and CallDetailsResponse include optional custom_attributes?: CustomAttributes | null containing arbitrary JSON metadata attached to the call. ListCallHistoryParams accepts custom_attributes?: readonly CustomAttributeFilter[] for query-level filtering.

Transcript types include TranscriptMessage, TranscriptTextMessage, TranscriptFunctionCallMessage, TranscriptWebSocketMessage, TranscriptDisplayMessage, and the role/session/thinking unions. The package also exports transcript parsing and normalization helpers; see Utilities.

Custom attributes

The /types entry exports types for modeling custom attributes on call sessions. The runtime helpers (attr, customAttributeQuery(), getCustomAttribute(), and the query builders) are exported from the package root:

  • CustomAttributes: { [key: string]: CustomAttributeValue } representing arbitrary JSON stored on the session (null when none).
  • CustomAttributeValue: any JSON value (CustomAttributeScalar | null | CustomAttributeValue[] | { [key: string]: CustomAttributeValue }).
  • CustomAttributeScalar: primitive filterable scalar (string | number | boolean).
  • CustomAttributeComparable: comparable operand (number | string | Date).
  • CustomAttributeOperator: union of the 22 supported comparison and array operators (eq, neq, gt, lt, gte, lte, btw, nbtw, like, ilike, nlike, nilike, startswith, endswith, in, nin, exists, isnull, contains, len, len_gt, len_gte, len_lt, len_lte).
  • CustomAttributeFilter: discriminated union representing a single { path, op, value } condition.
  • CustomAttributeOperatorValueMap: type mapping of operator names to their expected operand type.
  • CustomAttributeQueryBuilder (exported from the package root with customAttributeQuery()): chainable builder interface returned by customAttributeQuery().

Agent configuration

Agent types include AgentListItem, Agent, AgentDetail, AgentVersionListItem, ListAgentsParams, create/update requests, and prompt/version response models. Supporting configuration types describe availability, provider models, guardrails, function tools, knowledge-base attachments, structured output, and webhooks.

AgentType is single_prompt or workflow; AgentStatus is draft or published.

Knowledge-base models

The /types entry exports KnowledgeBase, KnowledgeBaseDetail, KnowledgeBaseStatus, ScrapedPage, ingestion metadata, list/create/update request and response types, and URL-discovery request/response types.

Integration credential models

The /types entry exports IntegrationCredential, IntegrationCredentialIntegration, IntegrationCredentialValues, IntegrationType, ListIntegrationCredentialsParams, ListIntegrationCredentialsResponse, CreateIntegrationCredentialRequest, and UpdateIntegrationCredentialRequest.

IntegrationType is ai_provider, telephony, calendar, server_credential, or object_storage. A credential's credentials field is a provider-specific Record<string, unknown>, and the API masks secret values in responses. See Integration Credentials for the hooks.

Component and hook types

Types that describe a runtime module ship with that module's entry point:

  • CallingAgentProviderProps and CallingAgentContextValue from the package root.
  • UseCallTranscriptOptions, UsePostCallSseOptions, CallExportOptions, and UseRecordingAudioReturn from /hooks.
  • CallHistoryListProps, CallDetailsProps, CallHistoryTableProps, TranscriptViewProps, AudioPlayerProps, and ExportButtonsProps from /ui.

Hooks also expose typed mutation inputs and results through TypeScript inference, so you rarely need to name them explicitly.

SDK errors

CallingAgentError is exported as a runtime class. Its code is a CallingAgentErrorCode: missing-config, unauthorized, forbidden, not-found, network, or unknown. It may also carry an HTTP status. See Provider & Setup for error handling.

Entry points

  • @scalereal/sr-voice-engine-react-sdk — runtime core: provider, errors, config, custom-attribute helpers, and CSV/PDF/formatting helpers.
  • @scalereal/sr-voice-engine-react-sdk/hooks — runtime data, realtime, and behavior hooks plus query keys.
  • @scalereal/sr-voice-engine-react-sdk/ui — runtime components; import the /css stylesheet alongside them.
  • @scalereal/sr-voice-engine-react-sdk/types — type-only domain models (this page).

Import shared models from /types, and pull prop or hook option types from the entry that exports the runtime they describe.

Related pages

  • Call History Use call-session and transcript types with the query hooks.
  • Agents Use agent and configuration models.
  • Integration Credentials Use credential models with the CRUD hooks.
  • Utilities Format and normalize SDK data.

Components

Add managed call-history views or compose the SDK's presentation components.

Utilities

Small hooks and helpers for timing, clipboard access, and formatting.

On this page

Shared typesCall sessions and transcriptsCustom attributesAgent configurationKnowledge-base modelsIntegration credential modelsComponent and hook typesSDK errorsEntry pointsRelated pages