@adcp/sdk API Reference - v10.0.1
    Preparing search index...

    Function inlineCreativesForPackages

    • Project library-scoped creative assets into package-scoped inline creative payloads for create_media_buy or update_media_buy.

      The helper is pure: it performs no network calls, does not call sync_creatives, and does not generate idempotency keys. Use supportsSyncCreatives(caps) to decide whether the seller has a creative library. When it does not, spread this helper's result into packages[].creatives and use a fresh idempotency key for the enclosing create/update media-buy call.

      Type Parameters

      Parameters

      Returns InlineCreativePackagePatch<TPackage>[]

      const caps = await agent.getCapabilities();
      if (supportsSyncCreatives(caps)) {
      await agent.syncCreatives({ account, creatives, assignments });
      } else if (caps.features.inlineCreativeManagement) {
      await agent.createMediaBuy({
      account,
      idempotency_key: crypto.randomUUID(),
      packages: inlineCreativesForPackages(packages, creatives, { assignments }),
      });
      } else {
      throw new Error('Seller supports neither creative library sync nor inline creative uploads.');
      }