Skip to content

InTaVia/api-client

Repository files navigation

InTaVia api client

this ia a typescript client for the intavia api.

you can find more info about the project on the intavia website.

how to use

configure the api base url:

import { configureApiBaseUrl } from "@intavia/api-client";

const baseUrl = process.env.NEXT_PUBLIC_INTAVIA_API_BASE_URL;

configureApiBaseUrl(baseUrl);

call endpoint:

import { searchEntities } from "@intavia/api-client";

const response = await searchEntities.request({ q: "stefan" });

use zod validation schemas:

import type { Person } from "@intavia/api-client";
import { person as personSchema } from "@intavia/api-client";

const person: Person = {
	id: "1",
	kind: "person",
	label: { default: "stefan" },
};

const result = personSchema.safeParse(person);

if (result.success === true) {
	console.log("Definitely a person.\n", result.data);
} else {
	console.error("You sure this is a person?\n", result.error);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •