@contentauth/c2pa-js
    Preparing search index...

    A Context configures the behavior of a Reader/Builder.

    It is provided at creation time (e.g. Reader.fromBlob(c2pa, format, blob, context)), configuring that instance's behavior independently of other instances.

    A Context is snapshotted when used to create a Reader/Builder. Changes to the context do not propagate afterwards, and therefore can be used to create multiple Reader/Builder instances.

    Index

    Accessors

    Constructors

    Methods

    Accessors

    • get sdkConfig(): SdkConfig | undefined

      The SDK config currently attached to this Context, if any.

      To derive a new Context with a different SDK config, construct one with new Context(settings, sdkConfig).

      Returns SdkConfig | undefined

    • get settings(): Settings | undefined

      The settings currently attached to this Context, if any.

      To derive a new Context with different settings, construct one with new Context(settings). To combine this Context's settings with more settings, merge them with mergeSettings first and pass the single, merged result to the constructor.

      Returns Settings | undefined

    Constructors

    • Parameters

      • Optionalsettings: Settings

        Core SDK settings.

      • OptionalsdkConfig: SdkConfig

        JavaScript SDK configuration.

      • Optionaloptions: ContextOptions

        JavaScript SDK behavior options, including trust-resource fetching controls.

      Returns Context

    Methods

    • Resolves this Context's settings (fetching any embedded trust-anchor URLs) and serializes the result for consumption by the WASM/native boundary. A successful result is memoized, so resolution of this Context's settings only happens once. If different fetch-with-retry options need to be provided after resolution succeeds, callers should create a separate Context with the desired options.

      A failed resolution is not memoized: the next call to toJson() tries again from scratch, so a transient failure (e.g. a network error while fetching a trust-anchor URL) doesn't permanently break this Context.

      Parameters

      • Optionaloptions: TrustFetchOptions

        Optional configurations for trust-resource fetching. These override the corresponding options attached to this Context. Explicit undefined resets an option to its SDK default; omitted properties retain the Context's option. This does not clear core settings or a memoized successful result. Only consulted on the first call, or the first call after a previous failure.

      Returns Promise<string>

      A JSON-serialized string of the resolved settings.