Skip to main content

APIs and SDKs

Introduction

Husonym has first-class APIs and SDKs that developers can use to integrate Husonym into their workflow. To learn more about how the Husonym API fits into the overall architecture, check out the Check out the platform page.

Husonym API serves up Connect, which can listen using Connect, gRPC, or HTTP protocols. All of our APIs are generated from Protobuf files and our SDKs call Connect endpoints by default. Each SDK can be configured to use gRPC or REST in lieu of the default (Connect).

Configuration

There are a few inputs that any SDK needs in order to be properly configured.

  1. API URL
  2. Account ID
  3. API Key (required for Husonym Cloud or self-hosted authenticated environments)

API Url

If using Husonym Cloud, the backend api url is: https://husonym-api.svcs.husonym.com

The standard localhost url is: http://localhost:8080

Account ID

The account ID is necessary for some requests that do not have an obvious identifier like retrieving a list of jobs, or a list of connections. This can be found by going into the app on the /:accountName/settings page and found in the header.

API Key

An access token (api key, or user jwt) must be used to access authenticated Husonym environments. For an API Key, this can be created at /:accountName/settings/api-keys.

Clients

Go

The Go SDK that is committed to the Husonym repo may be freely imported and utilized. See the Go SDK page for more information on how to use the SDK.

All of the generated code lives here.

TypeScript

The TypeScript SDK is published to the npm registry. It is generated from Husonym protos and is used by the Husonym App. See the TS SDK page for more information on how to use the SDK.

All of the generated code lives here.

Protos

All of Husonym's protos are public and can be found here. A new SDK can be easily generated by augmenting the buf.gen.yaml file, or providing a separate one when running the buf cli to generate a different SDK for other purposes.