A library for interacting with the backend and defining the backend API for personal projects.
To add to a repo, follow the instructions below for your environment:
Run yarn add @aneuhold/core-ts-api-lib
The below instructions still allow for things like Renovate to work, and normal commands with yarn such as yarn up
.
- Add the required JSR configuration to a
.yarnrc.yml
file if not there already:npmScopes: jsr: npmRegistryServer: 'https://npm.jsr.io'
- Add the package with
yarn add @jsr/aneuhold__core-ts-api-lib
Run deno add jsr:@aneuhold/core-ts-api-lib
Pull in one of the services and use it like so:
import { APIService } from '@aneuhold/core-ts-api-lib';
// If using Node with JSR
// import { APIService } from '@jsr/aneuhold__core-ts-api-lib';
export default async function validateUser() {
const userInfo = await APIService.validateUser({
username: 'user',
password: 'pass'
});
console.log(userInfo);
}