Releases: corticph/corti-sdk-javascript
Releases · corticph/corti-sdk-javascript
v1.0.0-rc.8
SDK regeneration
v1.0.0
Overview
This release delivers a broad SDK refresh with improved API coverage, stronger authentication workflows, and more reliable real-time streaming behavior. It also includes a few compatibility-impacting updates, so please review breaking changes before upgrading.
❗ Breaking changes
- Auth token model/type rename: Auth request/response types changed from
AuthGetTokenRequest/GetTokenResponseto OAuth-style token types, so code referencing old auth types will fail to compile.- Migration: Replace
Corti.AuthGetTokenRequestwithCorti.OAuthTokenRequestandCorti.GetTokenResponsewithCorti.AuthTokenResponse; update token request payloads to OAuth grant-specific shapes. - Example:
- Before:
const req: Corti.AuthGetTokenRequest = { clientId, clientSecret }; const res: Corti.GetTokenResponse = await auth.getToken(req);
- After:
const req: Corti.OAuthTokenRequest = { clientId, clientSecret }; const res: Corti.AuthTokenResponse = await auth.getToken(req);
- Before:
- Migration: Replace
getEnvironmentis no longer exported from the package root: Root-level imports ofgetEnvironmentare no longer available.- Migration: Import from the
utilssubpath export instead of@corti/sdk. - Example:
- Before:
import { getEnvironment } from "@corti/sdk";
- After:
import { getEnvironment } from "@corti/sdk/utils";
- Before:
- Migration: Import from the
connect(...)behavior changed for configured realtime sockets:CustomStream.connect(...)andCustomTranscribe.connect(...)now wait for config acknowledgement by default (awaitConfiguration: true) whenconfigurationis provided, which changes when the socket becomes usable and can affect message timing/visibility in existing listeners.- If you want old behavior (immediate socket access): Opt out with
awaitConfiguration: falseand keep your existing config-status handling flow.- Example:
const socket = await client.stream.connect({ id, configuration, awaitConfiguration: false, });
- Example:
- If you want new behavior (ack-safe default): Keep
awaitConfigurationastrue, removeCONFIG_ACCEPTED/other config-status handling from.on("message"), and start sending audio only afterawait connect(...)resolves.- Example:
const socket = await client.stream.connect({ id, configuration }); startAudio();
- Example:
- If you want old behavior (immediate socket access): Opt out with
- Socket config status kinds changed:
StreamConfigStatusMessageType.ConfigTimeoutis no longer part of the stream config status kind union, so code that explicitly matches this kind can fail type checks or miss fallback handling.- Migration: Update stream message-kind handling to rely on currently exported kinds (
ConfigAccepted,ConfigDenied,ConfigMissing,ConfigNotProvided,ConfigAlreadyReceived) and keep a default/fallback branch for unknown future kinds. - Example:
- Before:
if (msg.type === StreamConfigStatusMessageType.ConfigTimeout) { retry(); }
- After:
if ( msg.type === StreamConfigStatusMessageType.ConfigDenied || msg.type === StreamConfigStatusMessageType.ConfigMissing || msg.type === StreamConfigStatusMessageType.ConfigNotProvided ) { retry(); } else { // fallback }
- Before:
- Migration: Update stream message-kind handling to rely on currently exported kinds (
Changes
- feat(auth): extended
CortiAuthwith flow-specific methodsgetCodeFlowToken,getPkceFlowToken,getRopcFlowToken, andrefreshToken. - feat(auth): added
AuthClient.token(tenantName, request)forPOST /{tenantName}/protocol/openid-connect/tokenwithAuthTokenRequestBody. - feat(client): extended
CortiClientauth support to handle multiple flows throughauthoptions (client_credentials,authorization_code,pkce,ropc, and token-derivable auth). - feat(client): added
CortiClient.getAuthHeaders()to return resolvedAuthorizationandTenant-Nameheaders. - feat(utils): added
@corti/sdk/utilssubpath exports forgetEnvironment,decodeToken,generateCodeChallenge, andgenerateCodeVerifier. - feat(agents): expanded exported agent typing surface with new symbols including
AgentsCreateExpertReferenceType,AgentsCreateExpertType,AgentsMessageKind, andAgentsValidationErrorResponse. - feat(errors): added
UnprocessableEntityErrorand mapped 422 responses (for example inagents.getRegistryExperts(...)) to typed SDK errors. - feat(agents): added custom agents convenience support for card URL retrieval (
agents.getCardUrl(...)). - feat(stream): added retention policy type support via
StreamConfigXCortiRetentionPolicy(retain/none) on stream configuration. - fix(stream):
CustomStream.connect()now treatsStreamConfigStatusMessageType.ConfigAlreadyReceivedas accepted and handlesConfigNotProvided/ConfigMissingas config failures consistently. - fix(transcribe):
CustomTranscribe.connect()now treatsTranscribeConfigStatusMessageType.ConfigAlreadyReceivedas accepted and handlesConfigMissingas a config failure. - feat(codes): extended
CommonCodingSystemEnumwithicd10int-inpatient,icd10int-outpatient,icd10uk-inpatient, andicd10uk-outpatient.
v1.0.0-rc.7
feat: enhance stream and transcribe message handling for additional c…
v1.0.0-rc.6
chore: tsdoc comments
v1.0.0-rc.5
feat: introduce new authentication types and refactor auth handling i…
v1.0.0-rc.4
fix: set tenantName to null to avoid header rewriting issues
v1.0.0-rc.3
fix: tenantName was empty in auth URL
v1.0.0-rc.2
chore: remove unused imports and clean up header names
v1.0.0-rc.1
feat: enhance CortiAuth with tenant name support and strip Fern headers
v1.0.0-rc
feat: add tests for code prediction and stream connection with xCorti…