Skip to content
Sailhouse

Setup

Creating an account

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

Then, install the CLI.

brew install sailhouse/tap/sailhouse

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

sailhouse auth

Creating an app

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

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.

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

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.

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',
});