Skip to content

Wildberries API TypeScript SDK / warnOnce

Function: warnOnce()

ts
function warnOnce(methodKey: string, message: string): void;

Defined in: utils/deprecation.ts:28

Emit a deprecation warning for a method, at most once per process.

Parameters

ParameterTypeDescription
methodKeystringUnique identifier for the deprecated method (e.g. 'products.getCardsList:legacy-withphoto-zero')
messagestringThe warning message to display

Returns

void

Example

typescript
warnOnce(
  'products.getCardsList:legacy-withphoto-zero',
  '[DEPRECATED] withPhoto: 0 semantics changed. Use WITH_PHOTO_FILTER.NO_PHOTO for "no photo only".'
);

Made with ❤️ for the Wildberries developer community