Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 2.14 KB

README.md

File metadata and controls

66 lines (43 loc) · 2.14 KB

Grafana OpenAPI Client

TypeScript clients for the Grafana HTTP API, automatically generated from Grafana's OpenAPI specification using OpenAPI Generator.

Disclaimer: This is not an official Grafana HTTP client. Since Grafana does not provide the official HTTP client for JavaScript / TypeScript, I created these packages for the community to use. If you need more packages for specific versions, please let me know.

Packages

This repository contains multiple packages:

  • @grafana-openapi-client/axios - Axios-based HTTP client
  • @grafana-openapi-client/fetch - Fetch-based HTTP client

The version number is the Grafana version that the client is generated from.

You can check the source code and the README for each package from Releases, or just check the packages folder in the corresponding branch (e.g., release/11.4.0).

Installation

Choose your preferred HTTP client implementation (axios or fetch):

Using npm:

npm install @grafana-openapi-client/[email protected]
# or
npm install @grafana-openapi-client/[email protected]

Using yarn:

yarn add @grafana-openapi-client/[email protected]
# or
yarn add @grafana-openapi-client/[email protected]

Using pnpm:

pnpm add @grafana-openapi-client/[email protected]
# or
pnpm add @grafana-openapi-client/[email protected]

Development

Prerequisites

  • Node.js
  • Yarn
  • GitHub CLI (for releases)

Commands

  • yarn generate <version>: Generate API clients for a specific Grafana version.
    • For example, yarn generate 11.0.0 will generate clients for Grafana 11.0.0.
  • yarn build: Build packages in the packages folder, after generating the clients.
  • yarn release <version> [package_name]: Create a new release.
    • For example, yarn release 11.0.0 will create a new release for Grafana 11.0.0.

Check helper scripts under scripts for more details.

License

Apache License 2.0 - See LICENSE for more details.