Submits comments to the Akismet service.

Constructors

  • Creates a new client.

    Parameters

    • apiKey: string

      The Akismet API key.

    • blog: Blog

      The front page or home URL of the instance making requests.

    • options: Partial<ClientOptions> = {}

      An object providing values to initialize this instance.

    Returns Client

Properties

apiKey: string

The Akismet API key.

baseUrl: URL

The base URL of the remote API endpoint.

blog: Blog

The front page or home URL of the instance making requests.

isTest: boolean

Value indicating whether the client operates in test mode.

userAgent: string

The user agent string to use when making requests.

Methods

  • Checks the specified comment against the service database, and returns a value indicating whether it is spam.

    Parameters

    • comment: Comment

      The comment to be checked.

    Returns Promise<number>

    A value indicating whether the specified comment is spam.

  • Submits the specified comment that was incorrectly marked as spam but should not have been.

    Parameters

    • comment: Comment

      The comment to be submitted.

    Returns Promise<void>

    Resolves once the comment has been submitted.

  • Submits the specified comment that was not marked as spam but should have been.

    Parameters

    • comment: Comment

      The comment to be submitted.

    Returns Promise<void>

    Resolves once the comment has been submitted.

  • Checks the API key against the service database, and returns a value indicating whether it is valid.

    Returns Promise<boolean>

    true if the specified API key is valid, otherwise false.