@mestra-dev/contract
v0.0.139
Published
Types-only Hono AppType contract for the Mestra auth API
Readme
@mestra-dev/contract
Types-only package exporting the Mestra auth Hono AppType for frontend RPC clients.
Published artifact is only dist/index.d.ts — no runtime JavaScript.
Install
bun add @mestra-dev/contract
bun add hono # peer dependencyOr with npm:
npm install @mestra-dev/contract
npm install honoFrontend usage
import type { AppType } from '@mestra-dev/contract'
import { hc } from 'hono/client'
const client = hc<AppType>('https://api.mestra.chat/')
const res = await client.auth.me.$get()
if (res.ok) {
const data = await res.json()
} else if (res.status === 403) {
const err = await res.json() // { success: false, error: string }
} else if (res.status === 404) {
const err = await res.json()
}AppType includes per-route error bodies (400/403/404/…) plus global middleware errors (JWT, workspace access, rate limit → 400/401/403/404/429/500).
Always use import type so the bundler never pulls server code.
Build (maintainers)
Requires local services/core and services/utils sources plus core node_modules for type resolution. Those packages are not published with this contract.
cd services/hc
bun install
bun run buildOutput: dist/index.d.ts (self-contained; depends on hono types only).
Publish to npmjs
cd services/hc
bun run build
bun pm version patch # or: minor / major
bun publish --access publicprepublishOnly runs build automatically before publish.
Shortcut:
bun run release