@code-pushup/portal-client
v0.9.0
Published
Type definitions and client for uploading report to portal.
Downloads
6,135
Readme
Code PushUp portal client
Type definitions and client for uploading report to portal.
Setup
npm install @code-pushup/portal-client
Usage
Upload report to portal
import { uploadToPortal } from '@code-pushup/portal-client';
// ...
const report = await uploadToPortal({
server: '<GRAPHQL URL>',
apiKey: process.env.CODE_PUSHUP_API_KEY,
data: {
organization: '<ORGANIZATION SLUG>',
project: '<PROJECT SLUG>',
commit: '<COMMIT SHA>',
plugins: [
// ...
],
categories: [
// ...
],
// ...
},
});
Link to portal comparison page
import { getPortalComparisonLink } from '@code-pushup/portal-client';
// ...
const url = await getPortalComparisonLink({
server: '<GRAPHQL URL>',
apiKey: process.env.CODE_PUSHUP_API_KEY,
parameters: {
organization: '<ORGANIZATION SLUG>',
project: '<PROJECT SLUG>',
before: '<COMMIT SHA_1>',
after: '<COMMIT SHA_2>',
},
});