Skip to content

RageAgainstThePixel/unity-releases-api

Repository files navigation

unity-releases-api

Discord NPM Version NPM Downloads

A TypeScript package for communicating with the Unity Releases API

  • Automatically generated API client from the latest OpenAPI specification.
  • Fully typed models and methods for every endpoint.
  • Designed for use in a Node.js environment.

Installation

npm install @rage-against-the-pixel/unity-releases-api

Example

import dotenv from 'dotenv';
import {
    UnityReleasesClient,
    GetUnityReleasesData
} from 'unity-releases-api';

async function main() {
    dotenv.config();
    const client = new UnityReleasesClient();
    const query: GetUnityReleasesData = {
        query: {
            version: '6000.0',
            architecture: ['ARM64'],
            stream: ['LTS'],
            platform: ['WINDOWS'],
            order: 'RELEASE_DATE_DESC'
        }
    };
    const { data: response, error } = await client.api.ReleaseService.getUnityReleases(query);
    if (error) {
        console.error('Error fetching releases:', error);
    } else {
        console.log(JSON.stringify(response, null, 2));
    }
}

main();