An open API service indexing awesome lists of open source software.

https://github.com/nbbaier/valtown-api-types

Provides the Val Town OpenAPI spec as a ts export
https://github.com/nbbaier/valtown-api-types

Last synced: about 2 months ago
JSON representation

Provides the Val Town OpenAPI spec as a ts export

Awesome Lists containing this project

README

        

# valtown-api-types
This package provides the [Val Town OpenAPI spec](https://www.val.town/docs/openapi.yaml) as a Typescript file.

# Usage
This package is intended for use with a [`fets`](https://github.com/ardatan/feTS) API client.

```ts
import { NormalizeOAS, createClient } from "fets";
import openapi from "valtown-api-types";

const token = "";

const client = createClient>({
endpoint: "https://api.val.town",
});

const resp = await client["/v1/alias/{username}/{val_name}"].get({
params: { username: "nbbaier", val_name: "hello" },
headers: { Authorization: `Bearer ${token}` },
});

const val = await resp.json();
console.log(val);
```