POST
/
v1
/
fix-string-literals
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.stringLiteralFixer.run({
    file: {
      path: 'src/components/Button.tsx',
      contents: 'function Button() { return <button>Click me</button> }',
    },
  });

  console.log(response.data);
}

main();
{
  "data": {
    "status": "no_fix_needed",
    "contents": "function Button() { return <button>Click me</button> }",
    "message": "No string literal errors detected in the file",
    "diagnostics_found": 0
  },
  "meta": {
    "trace_id": "api_a04a904c-2cc0-49f2-bf5f-3ca0e9246f18",
    "external_id": "customer-batch-001"
  }
}

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.