@adobe/spacecat-shared-ahrefs-client
v1.10.3
Published
Shared modules of the Spacecat Services - Ahrefs Client
Maintainers
Keywords
Readme
Spacecat Shared - Ahrefs Client
A JavaScript client for the Ahrefs API v3, part of the SpaceCat Shared library. It allows you to query the Ahrefs API for top pages, backlinks, organic traffic data, and more.
Installation
Install the package using npm:
npm install @adobe/spacecat-shared-ahrefs-clientUsage
Constructor
import AhrefsAPIClient, { fetch } from '@adobe/spacecat-shared-ahrefs-client';
const config = {
apiKey: '<API_KEY>',
apiBaseUrl: '<API_BASE_URL>',
};
const client = new AhrefsAPIClient(config, fetch);Creating and instance from Helix UniversalContext
const context = {}; // Your AWS Lambda context object
const client = AhrefsAPIClient.createFrom(context);Testing
To run tests:
npm run testLinting
Lint your code:
npm run lintCleaning
To remove node_modules and package-lock.json:
npm run cleanAdditional Information
- Repository: GitHub
- Issue Tracking: GitHub Issues
- License: Apache-2.0
