Skip to main content
The Core SDK provides a type-safe client for the GBG Go Captain API. Use it on your server to authenticate, start journeys, manage tasks, connect devices, and generate the tokens and URLs needed to embed web journeys in your apps. Both language clients are generated from the same API specification, so they expose the same resources, the same methods, and the same request and response fields. Everything on this page applies to both; only the code differs. New to a language client? See TypeScript notes or Java notes for install details, runtime requirements, and language-specific features.

Installation

The TypeScript package ships with both CommonJS and ES module builds and includes TypeScript declarations. It supports Node.js 18+, Bun 1+, Deno 1.39+, and modern browsers. The Java client requires JDK 11 or later.

Authentication

Generate an access token with your API client credentials, then pass it to the SDK. Create API clients in the Clients tab of the Account management portal. See Manage API clients.
The SDK also supports the password grant, which additionally takes a username and password. Use client_credentials unless you have been told otherwise.
In TypeScript you can set the GO_CUSTOMER_ACCESS environment variable instead of passing the token directly, and the SDK reads it automatically. The Java client has no equivalent fallback, so read the variable yourself and pass it to customerAccess().

Region selection

GBG Go is deployed across three regions. Both clients expose the same server list in the same order, so you can select a region by index or set the URL directly.
Each region covers a wider area than the code in its URL suggests. For example, organisations in the United Kingdom use the Europe (eu) endpoint.
If you’re not sure which region your organisation is set up in, contact us.

Available operations

These are the resources and methods exposed by the SDK. The names are identical in both languages. TypeScript uses properties (go.tokens.generate()); Java uses accessor methods and a terminal .call() (go.tokens().generate().call()).

Start a journey

Pass the resource ID of the journey template you want to run. The response includes the instanceId you’ll use to track the journey.
The resourceId uses the format <id>@<version>. Use @latest to always run the current published version of the template.

Connect an end-user device

Generate a connect token on your server, then pass it to the end user’s device.
devices.connect uses the connect token as its credential rather than your customer access token, because it runs on the end-user device. In TypeScript you pass it as the first argument; in Java you pass it with .security().

Error handling

Every SDK call raises a single base error type carrying the HTTP status code and the response body.
The base error is called GoError in TypeScript and GoException in Java. In Java, network failures surface separately as UncheckedIOException rather than as an SDK error.

Retries

Configure retry behaviour when you build the client. Both languages use the same backoff strategy and the same parameters.

Language-specific guides

Some features exist in only one client. These pages cover installation in detail and everything that has no counterpart in the other language.

TypeScript notes

Runtime support, standalone functions for tree-shaking, custom HTTP client, and debugging.

Java notes

Gradle and Maven setup, asynchronous calls, Optional handling, Jackson configuration, and logging.

Further reading

For the complete generated API reference, see the SDK repository: