Skip to main content
The official Go SDK for TrailBase provides a type-safe client for accessing your TrailBase backend from Go applications.

Installation

Install using go get:

Requirements

  • Go 1.24.4+

Initialization

Basic Client

Client with Tokens

Authentication

Login

Logout

Current User

Access Tokens

Refresh Token

Record API

Define Your Record Types

List Records

Read a Record

Read with Expansion

Create a Record

Create Multiple Records

Update a Record

Delete a Record

Filtering

Available Comparison Operators

Error Handling

Type Definitions

User

Tokens

ListResponse

ListOptions

Pagination

Best Practices

Always check errors returned by SDK methods. Go’s explicit error handling ensures you don’t miss failure cases.
Store tokens securely and never commit them to version control. Consider using environment variables or secure credential storage.
The client automatically refreshes auth tokens before they expire through concurrent-safe token management.

Example Application