Typescript client for the GEWISDB API
This repository contains the client for the GEWISDB API. It is built using TypeScript and Axios, and utilizes the Swagger API specification for generating code.
To install and use this client, follow these steps:
- Clone the repository:
git clone https://github.com/GEWIS/gewisdb-ts-client.git
- Install dependencies:
npm install
To build the client, run npm run gen-build
This will first generate the TypeScript code under ./src and then generate the necessary files in the dist/
directory.
import {Configuration, MembersApi} from "gewisdb-ts-client";
const apiKey = 'API_KEY'
const basePath = 'https://database.test.gewis.nl/api'
const configuration = new Configuration({basePath, accessToken: () => apiKey});
const membersApi = new MembersApi(configuration);
membersApi.membersGet().then((res) => {
console.log(res.data);
}).catch((err) => {
console.error(err);
});
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on the issue tracker.