Grexx Platform API TypeScript Client

13.6.2 · active · verified Tue Apr 21

The `grexx-api` package provides a strongly-typed TypeScript client for interacting with the Grexx Platform API, which is generated from an OpenAPI 3.0.2 specification. It enables developers to manage various Grexx platform entities such as cases, datasets, forms, and tasks programmatically. This client abstracts the HTTP request details, offering a more intuitive and type-safe interface for API operations. As of version 13.6.2, it is actively maintained, with new releases typically aligning with updates to the underlying Grexx Platform API or improvements in the OpenAPI generator itself. Its primary differentiator is the full TypeScript support, ensuring compile-time safety and a better development experience compared to direct HTTP requests.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates initializing the Grexx API client and retrieving information for a specific case using the `CaseService`.

import { OpenAPI, CaseService } from 'grexx-api';

// Configure the API client with your base URL and API key
OpenAPI.BASE = process.env.GREXX_API_BASE_URL ?? 'https://name.grexx.today/api/v1';
OpenAPI.TOKEN = process.env.GREXX_API_KEY ?? 'your-api-key'; // Replace with a secure way to load your API key

const casePath = 'example-case-id'; // Replace with a valid case ID from your Grexx platform

CaseService.caseInfo(casePath, { css: true, rootline: false })
  .then(response => {
    console.log('Successfully fetched Case Info:');
    console.log(`Case ID: ${response.id}`);
    console.log(`Case Title: ${response.title}`);
  })
  .catch(error => {
    console.error('Error fetching case info:', error.message || error);
    if (error.status) {
      console.error(`Status: ${error.status}, Body: ${JSON.stringify(error.body)}`);
    }
  });

view raw JSON →