PgBeam Docs

Installation & Setup

Install the pgbeam-go package, configure the client, authenticate, and learn the service-based access pattern.

Installation

The Go SDK is coming soon. Package publishing is on the roadmap.

go get github.com/pgbeam/pgbeam-go

Client setup

import pgbeam "github.com/pgbeam/pgbeam-go"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
    APIKey:  "pgb_your_api_key",
    BaseURL: "https://api.pgbeam.com", // optional
})

Constructor options

OptionTypeDescription
APIKeystringPgBeam API key (required, prefix pgb_)
BaseURLstringAPI base URL (default: https://api.pgbeam.com)
HTTPClient*http.ClientCustom HTTP client for proxies, timeouts, etc.

Authentication

client := pgbeam.NewClient(&pgbeam.ClientOptions{
    APIKey:  "pgb_your_api_key",
    BaseURL: "https://api.pgbeam.com",
})
client := pgbeam.NewClient(&pgbeam.ClientOptions{
    APIKey:  os.Getenv("PGBEAM_API_KEY"),
    BaseURL: os.Getenv("PGBEAM_API_URL"),
})

See API Keys for key creation and rotation.

Usage pattern

The Go SDK uses service-based access, matching the TypeScript SDK's tag-based api.projects.*, api.databases.* pattern:

// Projects
resp, err := client.Projects.CreateProject(ctx, &pgbeam.CreateProjectRequest{...})
project, err := client.Projects.GetProject(ctx, "prj_xxx")

// Databases
db, err := client.Databases.GetDatabase(ctx, "prj_xxx", "db_xxx")

// Analytics
plan, err := client.Analytics.GetOrganizationPlan(ctx, "org_xxx")

// Platform
health, err := client.Platform.GetHealth(ctx)

// Account
data, err := client.Account.ExportAccountData(ctx)
ServiceGoTypeScript equivalent
Projectsclient.Projectsapi.projects
Databasesclient.Databasesapi.databases
Analyticsclient.Analyticsapi.analytics
Platformclient.Platformapi.platform
Accountclient.Accountapi.account

On this page