Skip to content
프로젝트

소개

Supabase용 Go 클라이언트 라이브러리

개발 도구

이 수치를 측정하는 방법

What you can do

  • Realtime listeners for database changes
  • Access your database using a REST API generated from your schema & database functions
  • User authentication, including OAuth, email/password, and native sign-in
  • Store files in S3 with additional managed metadata

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

[!IMPORTANT] Update, September 2026:
This codebase is not being actively maintained by Supabase or the community, but it's not the end of the road... We're busy building an official Supabase SDK for Go that will make this repository and the module it publishes obsolete. This thread has more information, as well as providing a venue for discussion in the meantime.

An isomorphic Go client for Supabase.

Features

  • Integration with Supabase.Realtime
    • Realtime listeners for database changes
  • Integration with Postgrest
    • Access your database using a REST API generated from your schema & database functions
  • Integration with Gotrue
    • User authentication, including OAuth, email/password, and native sign-in
  • Integration with Supabase Storage
    • Store files in S3 with additional managed metadata
  • Integration with Supabase Edge Functions
    • Run serverless functions on the edge

Quickstart

  1. To get started, create a new project in the Supabase Admin Panel.
  2. Grab your Supabase URL and Supabase Public Key from the Admin Panel (Settings -> API Keys).
  3. Initialize the client!

Reminder: supabase-go has some APIs that require the service_key rather than the public_key (for instance: the administration of users, bypassing database roles, etc.). If you are using the service_key be sure it is not exposed client side. Additionally, if you need to use both a service account and a public/user account, please do so using a separate client instance for each.

Documentation

Installation

Install the library to your go project:

  go get github.com/supabase-community/supabase-go

Quick start

  client, err := supabase.NewClient(API_URL, API_KEY, &supabase.ClientOptions{})
  if err != nil {
    fmt.Println("Failed to initalize the client: ", err)
  }

Client configuration

Basic Client

client, err := supabase.NewClient(url, key, nil)

Client with custom options

options := &supabase.ClientOptions{
    Headers: map[string]string{
        "X-Custom-Header": "custom-value",
    },
    Schema: "custom_schema", // defaults to "public"
}

client, err := supabase.NewClient(url, key, options)

Querying data

  // ...

  data, count, err := client.From("countries").Select("*", "exact", false).Execute()

For more see postgrest-go Query Builder documentation

Authentication

The client provides comprehensive authentication features through the integrated GoTrue client.

Email/Password Authentication

// Sign in with email and password
session, err := client.SignInWithEmailPassword("[email protected]", "password")
if err != nil {
    log.Fatal("Sign in failed:", err)
}

fmt.Printf("User ID: %s\n", session.User.ID)
fmt.Printf("Access Token: %s\n", session.AccessToken)

Phone/Password Authentication

// Sign in with phone and password
session, err := client.SignInWithPhonePassword("+1234567890", "password")
if err != nil {
    log.Fatal("Sign in failed:", err)
}

Token Management

Manual Token Refresh

// Refresh an expired token
newSession, err := client.RefreshToken(session.RefreshToken)
if err != nil {
    log.Fatal("Token refresh failed:", err)
}

Automatic Token Refresh

// Enable automatic token refresh in the background
client.EnableTokenAutoRefresh(session)

// The client will automatically:
// - Refresh tokens before they expire (at 75% of expiry time)
// - Retry failed refreshes with exponential backoff
// - Update all service clients with new tokens

관련 프로젝트 살펴보기

불러오는 중…