Create transcriptions from uploaded recordings and retrieve results.
JavaScript
// Create a transcript from a recordingconst { id: transcriptId } = await client.transcripts.create(interactionId, { recordingId, primaryLanguage: "en",});// Check transcription statusconst status = await client.transcripts.getStatus(interactionId, transcriptId);// List transcripts for an interactionconst transcripts = await client.transcripts.list(interactionId);// Get a specific transcriptconst result = await client.transcripts.get(interactionId, transcriptId);// Delete a transcriptawait client.transcripts.delete(interactionId, transcriptId);
List and inspect document generation templates available to your tenant.
JavaScript
// List all templatesconst templates = await client.templates.list();// Get a specific template by keyconst template = await client.templates.get("corti-soap");// List template sectionsconst sections = await client.templates.sectionList();
const response = await client.codes.predict({ system: ["icd10cm-inpatient"], context: [ { type: "text", text: "Progress Note — Day 3: Patient continues on IV vancomycin for MRSA bacteremia. Blood cultures from yesterday still pending. Acute kidney injury improving — creatinine down to 1.8 from 2.4. Patient also has history of CHF, currently euvolemic on home dose of furosemide. Diabetes managed with insulin sliding scale, glucose well controlled.", }, ],});
Stream configuration (transcription language, participants, mode). When provided, the SDK automatically sends the config message once the socket opens. If omitted, you must call sendConfiguration() yourself
awaitConfiguration
boolean
No
When true (default), connect() waits for CONFIG_ACCEPTED before resolving. When false, returns the socket immediately and dispatches config errors as events
proxy
ProxyOptions
No
Route through a proxy instead of connecting directly. Connects to the provided URL exactly as-is (no endpoint path is appended)
debug
boolean
No
Enable debug logging
reconnectAttempts
number
No
Number of reconnection attempts on disconnect
The SDK injects tenantName and token automatically. If configuration is provided and awaitConfiguration is true, the promise rejects when the stream configuration is denied (CONFIG_DENIED, CONFIG_MISSING, CONFIG_NOT_PROVIDED).
Subscribe to events: "open", "message", "close", "error"
off(event, handler?)
Remove an event handler
sendAudio(data)
Send binary audio data (ArrayBuffer, Blob, or ArrayBufferView)
sendFlush(message)
Request the server to flush buffered audio and return results
sendEnd(message)
Signal end of audio stream
sendConfiguration(message)
Send a configuration message (used internally by connect)
send(data)
Send raw data directly on the underlying WebSocket
close()
Close the connection and unregister event handlers. You should call sendEnd() first and wait for the ended message before closing — see Flush the Audio Buffer
waitForOpen()
Returns a promise that resolves when the socket is open
Transcribe configuration (language, punctuation, commands). When provided, the SDK automatically sends the config message once the socket opens. If omitted, you must call sendConfiguration() yourself
awaitConfiguration
boolean
No
When true (default), connect() waits for CONFIG_ACCEPTED before resolving. When false, returns the socket immediately and dispatches config errors as events
proxy
ProxyOptions
No
Route through a proxy instead of connecting directly. Connects to the provided URL exactly as-is (no endpoint path is appended)
debug
boolean
No
Enable debug logging
reconnectAttempts
number
No
Number of reconnection attempts on disconnect
The socket methods are the same as Stream (sendAudio, sendFlush, sendEnd, close, etc.). The key differences are:
No interaction ID — Transcribe operates standalone
Different message types — Transcribe delivers transcript, command, flushed, ended, usage, delta_usage, and error messages, while Stream delivers transcript, facts, flushed, ended, usage, delta_usage, and error
OAuth token management. In most cases you won’t call these directly — the SDK handles tokens automatically based on the auth option you pass to the constructor. These methods are useful for advanced scenarios like generating authorization URLs for browser-based flows.
Method
Description
getToken(request)
Get a token via client credentials
getRopcFlowToken(request)
Get a token via ROPC flow
getCodeFlowToken(request)
Exchange an authorization code for a token
getPkceFlowToken(request)
Exchange a PKCE authorization code for a token
refreshToken(request)
Refresh an expired token
authorizeURL(options)
Generate an authorization code flow URL and redirect to it
authorizePkceUrl(options)
Generate a PKCE flow redirect URL
For detailed usage and end-to-end examples, see the Authentication Guide. For standalone use without CortiClient, see CortiAuth below.
A standalone authentication client for when you need OAuth token management without the full CortiClient. Useful for proxy servers, custom backends, or applications that handle tokens separately from API calls.
JavaScript
import { CortiAuth } from "@corti/sdk";const auth = new CortiAuth({ environment: "<eu-or-us>", tenantName: "<your-tenant-name>",});
All token methods accept an optional scopes array. openid and profile are added automatically — pass additional scopes like "streams" or "transcribe" to get a scoped token.
Method
Description
Returns
getToken(request)
Get a token via client credentials
AuthTokenResponse
getRopcFlowToken(request)
Get a token via ROPC flow
AuthTokenResponse
getCodeFlowToken(request)
Exchange an authorization code for a token
AuthTokenResponse
getPkceFlowToken(request)
Exchange a PKCE authorization code for a token
AuthTokenResponse
refreshToken(request)
Refresh an expired token
AuthTokenResponse
authorizeURL(options)
Generate an authorization code flow URL and redirect to it
string
authorizePkceUrl(options)
Generate a PKCE flow redirect URL
string
CortiAuth.getCodeVerifier()
Get the PKCE code verifier from the last authorizePkceUrl call (static)
string | null
For end-to-end examples and detailed usage of each method, see the Authentication Guide.
A lightweight client for WebSocket-only proxy scenarios. Unlike CortiClient, it requires no environment, tenant, or authentication configuration — all routing is handled by the proxy option you pass at connect time.
JavaScript
import { CortiWebSocketProxyClient } from "@corti/sdk";
The @corti/sdk/utils sub-package exports helper functions for token inspection, environment resolution, and PKCE. These are useful in proxy servers, middleware, and custom authentication flows.
JavaScript
import { decodeToken, getEnvironment, generateCodeVerifier, generateCodeChallenge} from "@corti/sdk/utils";
Export
Description
decodeToken(token)
Decode a Corti JWT to extract environment, tenantName, accessToken, and expiresAt. Returns null if the token is invalid or the issuer doesn’t match
getEnvironment(env)
Normalize an environment string (e.g. "eu") or CortiEnvironment object into the internal URL format the SDK uses
generateCodeVerifier()
Generate a PKCE code verifier (32 random bytes, base64url-encoded)
generateCodeChallenge(verifier)
Compute the PKCE code challenge from a verifier (SHA-256, base64url-encoded). Returns a Promise
DecodedToken
TypeScript type for the return value of decodeToken