NorskSettings interface

Top level Norsk configuration

Signature:

export interface NorskSettings

Properties

Property Type Description

abortSignal?

AbortSignal

(Optional) As connectTimeoutMs, but driven by an AbortSignal.

connectTimeoutMs?

number

(Optional) Give up on connect() after this many milliseconds: the instance is closed (releasing the shared engine connection if nothing else uses it) and connect() rejects. Unset = wait for the engine indefinitely (the onFailedToConnect callback still fires after 60 s, informationally).

grpc?

Partial<grpc.ClientOptions>

(Optional)

onAttemptingToConnect?

() ⇒ void

(Optional)

onConnecting?

() ⇒ void

(Optional)

onCurrentLoad?

(load: CurrentLoad) ⇒ void

(Optional)

onFailedToConnect?

() ⇒ void

(Optional)

onHello?

(version: Version) ⇒ void

(Optional)

onIrohEndpointEvent?

(event: IrohEndpointEvent) ⇒ void

(Optional) A connection event on the shared iroh endpoint (peer connected / rejected by the allow-list / disconnected). remoteNodeId is the peer’s TLS-verified public key (64-char hex).

onLicenseChallenge?

(challenge: Uint8Array) ⇒ Promise<LicenseChallengeResponse> | LicenseChallengeResponse

(Optional) Licensing V2: respond to the engine’s license challenge. Engines holding a per-product (V2) license send a challenge nonce in their hello and refuse to create media nodes until a product (e.g. Studio) has answered it with its certs and signatures. V1-licensed engines never issue a challenge, so plain SDK applications can ignore this setting entirely.

onLicenseChallengeFailed?

(message: string) ⇒ void

(Optional) Licensing V2: called if the license handshake fails (or no responder was supplied). connect() still resolves; norsk.licenseHandshake carries the same outcome. Media node creation will be refused by the engine.

onLicenseEvent?

(message: string, running: boolean, fullEvent: LicenseEvent) ⇒ void

(Optional) Manually handle license events, such as missing/invalid licenses and sandbox timeout. (Logs messages to console by default.)

onLogEvent?

(log: Log) ⇒ void

(Optional)

onNodeError?

(event: NodeErrorEvent) ⇒ void

(Optional) Called when any media node created through this connection fails: its gRPC stream ends with an error (the node exited abnormally on the engine, or the stream broke), other than a close this client requested. Fires for every node, whether or not that node’s own NodeSettings.onError is set; handled says whether it was. A connection-wide place to notice a node dying when the graph would otherwise just go quiet.

onNotification?

(notification: Notification) ⇒ void

(Optional)

onNotificationCleared?

(cleared: NotificationCleared) ⇒ void

(Optional) A previously-raised notification has been retracted (condition cleared)

onReady?

() ⇒ void

(Optional)

onShutdown?

() ⇒ void

(Optional) Code to execute if the Norsk node is shutdown - by default it logs and nothing else

transport?

MediaClientLike

(Optional) Inject a transport in place of the real grpc MediaClient — e.g. a scripted fake for unit testing without a running engine. When omitted, the SDK constructs a real MediaClient against url exactly as before.

url?

string

(Optional) Callback URL to listen on for gRPC session with Norsk Media Defaults to $NORSK_HOST:$NORSK_PORT if the environment variables are set where NORSK_HOST defaults to "127.0.0.1" and NORSK_PORT to "6790" (so "127.0.0.1:6790" if neither variable is set)