Skip to content
Sailhouse
GitHubDiscord

Setup

This guide is focused on getting up to speed with the CLI. You can use the dashboard for a web-focused experience.

Creating an account

First things first, get signed in and create a team.

Then, install the CLI.

And connect to your fresh-faced, lovely, new account.

Terminal window
sailhouse auth

Creating an app

In Sailhouse, apps are the logical separator for your topics. This could be environments, projects, apps, whatever.

Terminal window
sailhouse apps create [slug]

Oh yeah, we do everything with slugs too.

Get sending events

We have a few language-native SDKs/clients available

Creating a token

To send an event on Sailhouse, you need a token to authenticate the SDK.

With your CLI authenticated, you can create a token easily.

Terminal window
sailhouse tokens create

Then, taking the sh_app_ prefixed value, you can store that in an environment variable on the platform you’re running in.

Using the Go SDK

First, adding the SDK package

Terminal window
go get -u github.com/sailhouse/sdk-go/sailhouse

Then, a basic example which reads the token from an environment variable SAILHOUSE_TOKEN.

package main
import (
"github.com/sailhouse/go-sdk/sailhouse"
)
func main() {
client := sailhouse.NewSailhouseClient(os.Getenv("SAILHOUSE_TOKEN"))
client.Publish("awesome-example", map[string]string{
"message": "Hello World!",
})
}

Using the TypeScript SDK

First, installing the SDK.

Terminal window
npm install @sailhouse/client

Then a basic example ,taking advantage of top-level await.

import { SailhouseClient } from "@sailhouse/client";
const client = new SailhouseClient(process.env.SAILHOUSE_TOKEN);
await client.publish("signups", {
email: 'hello@sailhouse.dev',
type: 'pro',
});