Avena Webapp API - v0.0.1
    Preparing search index...

    Function updateConfig

    • Writes a configuration object to KV as JSON.

      The object is serialized with two-space indentation. Errors are logged to the console and reported through the return value instead of being thrown.

      Uses shared when it is given and still open, which saves the connection setup (several round trips on a slow link); it is left open. Otherwise a new connection is opened and always closed before returning.

      Parameters

      • serverName: string

        Server text passed to connect.

      • credentialsContent: string

        Contents of a .creds file, not a path.

      • bucket: string

        KV bucket name, e.g. avenabox.

      • key: string

        Key to write, e.g. <site>.<box>.<source>.config.

      • configData: any

        Value passed to JSON.stringify.

      • Optionalshared: NatsService | null

        Open connection to reuse, such as the page's own. Optional.

      Returns Promise<boolean>

      true if the value was written, false if connecting or writing failed.