POST
/
v1
/
diagnostics
import Benchify from 'benchify';

const client = new Benchify({
  apiKey: process.env['BENCHIFY_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.diagnostics.run({
    files: [
      {
        path: 'src/component.tsx',
        contents: "function Button() { return <button className='bg-blue'>Click me</button> }",
      },
    ],
  });

  console.log(response.data);
}

main();
{
  "data": {
    "issues": [
      {
        "type": "<string>",
        "message": "<string>",
        "location": {
          "file": "<string>",
          "line": 123,
          "column": 123
        }
      }
    ]
  },
  "meta": {
    "fixer_run_id": "<string>",
    "trace_id": "<string>",
    "external_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Benchify API Key. Obtain a key from the Benchify web portal under Settings > Credentials. Provide the key in the Authorization header as Bearer $BENCHIFY_KEY.

Body

application/json

Response

200
application/json

Successful operation

The response is of type object.