@adcp/sdk API Reference - v17.0.0-rc.0
    Preparing search index...

    Interface CreateReliableReportingConsumerOptionsV1<TCredential>

    interface CreateReliableReportingConsumerOptionsV1<TCredential = unknown> {
        accounts: readonly ReliableReportingConsumerAccountV1<TCredential>[];
        persistence?: ReliableReportingConsumerPersistenceV1;
        storage?: {
            consumer: ReliableReportingConsumerPersistenceV1;
            durability: "process-local" | "durable";
        };
        ownerToken: string;
        pollIntervalMs?: number;
        leaseMilliseconds?: number;
        maxConcurrentAccounts?: number;
        runOnStart?: boolean;
        onResult?: (
            result: ReliableReportingConsumerRunResultV1,
        ) => void | Promise<void>;
        onPrincipalChanged?: (
            input: { consumerScope: string; notification: PrincipalChangedWebhook },
        ) => void | Promise<void>;
        onError?: (
            error: unknown,
            accountId: string,
            context: ReliableReportingConsumerErrorContextV1,
        ) => void | Promise<void>;
    }

    Type Parameters

    • TCredential = unknown
    Index

    The consumer's durable state. Required without storage.

    storage?: {
        consumer: ReliableReportingConsumerPersistenceV1;
        durability: "process-local" | "durable";
    }

    The one storage decision (memoryStorage() from @adcp/sdk/storage, postgresStorage({ pool }) from @adcp/reporting-storage): its consumer stores are the persistence. Pass storage or persistence, not both.

    Reporting storage (AdCP 3.3).

    Type Declaration

    ownerToken: string

    Unique per running process. It is coordination metadata, not a credential.

    pollIntervalMs?: number
    leaseMilliseconds?: number
    maxConcurrentAccounts?: number
    runOnStart?: boolean
    onResult?: (
        result: ReliableReportingConsumerRunResultV1,
    ) => void | Promise<void>
    onPrincipalChanged?: (
        input: { consumerScope: string; notification: PrincipalChangedWebhook },
    ) => void | Promise<void>

    Called for an authenticated principal.changed before the scope's accounts are reconciled.

    onError?: (
        error: unknown,
        accountId: string,
        context: ReliableReportingConsumerErrorContextV1,
    ) => void | Promise<void>

    Errors from background work and hooks. The third argument identifies the durable partition.