A JavaScript client for Adobe's Real User Monitoring (RUM) API, part of the SpaceCat Shared library.
Install the package using npm:
npm install @adobe/spacecat-shared-rum-api-client
const context = {}; // Your AWS Lambda context object
const rumApiClient = RUMAPIClient.createFrom(context);
RUMAPIClient
class needs RUM API domain key to be instantiated:
const domainKey = "your-domain-key";
const rumApiClient = new RUMAPIClient(domainKey);
const url = "https://example.com";
const expiryInDays = 7;
const backlink = await rumApiClient.createRUMBacklink(url, expiryInDays);
console.log(`Backlink created: ${backlink}`)
const url = "https://example.com";
const expiryInDays = 7;
const backlink = await rumApiClient.create404Backlink(url, expiryInDays);
console.log(`Backlink created: ${backlink}`)
const url = "example.com";
const rumData = await rumApiClient.getRUMDashboard({ url });
console.log(`RUM data: ${rumData}`)
const url = "example.com";
const backlink = await rumApiClient.get404Sources({ url });
console.log(`404 Checkpoints: ${backlink}`)
const url = "all";
const domains = await rumApiClient.getDomainList({}, url);
console.log(`Backlink created: ${backlink}`)
Run the included tests with the following command:
npm test
Lint the codebase using:
npm run lint
To clean the package (remove node_modules
and package-lock.json
):
npm run clean
Find the source code and contribute here.
Report issues or bugs here.
This project is licensed under the Apache-2.0 License.