Skip to content

enderdash-com/enderdash-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnderDash Client

TypeScript client for the EnderDash HTTP API.

The client is generated from EnderDash's OpenAPI document and configured for the tRPC HTTP protocol. It uses superjson, matching the EnderDash API transformer.

Install

bun add @enderdash/client

Usage

import { createEnderDashClient } from "@enderdash/client";

const enderdash = createEnderDashClient({
  apiKey: process.env.ENDERDASH_API_KEY,
});

const servers = await enderdash.servers.listServers({
  query: {
    input: {
      organizationSlug: "test",
    },
  },
});

Pass baseUrl when targeting a local or self-hosted EnderDash app:

const enderdash = createEnderDashClient({
  apiKey: process.env.ENDERDASH_API_KEY,
  baseUrl: "https://app.enderdash.localhost:1355/api/trpc",
});

Regenerate

bun run generate

By default, generation uses https://app.enderdash.com/openapi.json.

To generate from another spec:

ENDERDASH_OPENAPI_SPEC=./openapi.json bun run generate

Development

bun install
bun run generate
bun run check
bun run build

Publishing

Publishing runs from GitHub releases through .github/workflows/publish.yml.

The workflow publishes to npm and JSR with GitHub OpenID Connect tokens.

Before the first npm release, configure npm trusted publishing for @enderdash/client with:

  • owner: enderdash-com
  • repository: enderdash-client
  • workflow: publish.yml

Before the first JSR release, create or open @enderdash/client on JSR, then link it to:

  • repository: enderdash-com/enderdash-client

Then publish by creating a GitHub release for the version in package.json.

About

🌃 TypeScript client for the EnderDash HTTP API

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors