Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) EnableTokenAutoRefresh(session types.Session)
- func (c *Client) ExchangeCode(code, codeVerifier string) (types.Session, error)
- func (c *Client) From(table string) *postgrest.QueryBuilder
- func (c *Client) RefreshToken(refreshToken string) (types.Session, error)
- func (c *Client) Rpc(name, count string, rpcBody interface{}) string
- func (c *Client) SignInWithEmailPassword(email, password string) (types.Session, error)
- func (c *Client) SignInWithPhonePassword(phone, password string) (types.Session, error)
- func (c *Client) SignInWithProvider(provider types.Provider, redirectTo string) (*types.AuthorizeResponse, error)
- func (c *Client) SignUp(email, password string, data map[string]interface{}) (*types.SignupResponse, error)
- func (c *Client) SignUpWithEmailOTP(email string, options *SignUpOptions) error
- func (c *Client) UpdateAuthSession(session types.Session)
- func (c *Client) VerifyEmailOTP(email, code string) (*types.Session, error)
- type ClientOptions
- type SignUpOptions
Constants ¶
const ( REST_URL = "/rest/v1" STORAGE_URL = "/storage/v1" AUTH_URL = "/auth/v1" FUNCTIONS_URL = "/functions/v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Storage *storage_go.Client
// Auth is an interface. We don't need a pointer to an interface.
Auth auth.Client
Functions *functions.Client
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(url, key string, options *ClientOptions) (*Client, error)
NewClient creates a new Supabase client. url is the Supabase URL. key is the Supabase API key. options is the Supabase client options.
func (*Client) EnableTokenAutoRefresh ¶
func (*Client) ExchangeCode ¶
ExchangeCode exchanges the authorization code for a session token after OAuth sign-in. The codeVerifier is the PKCE verifier returned from SignInWithProvider.
func (*Client) From ¶
func (c *Client) From(table string) *postgrest.QueryBuilder
Wrap postgrest From method From returns a QueryBuilder for the specified table.
func (*Client) RefreshToken ¶
func (*Client) SignInWithEmailPassword ¶
func (*Client) SignInWithPhonePassword ¶
func (*Client) SignInWithProvider ¶
func (c *Client) SignInWithProvider(provider types.Provider, redirectTo string) (*types.AuthorizeResponse, error)
SignInWithProvider initiates OAuth sign-in with the specified provider. It returns the authorization URL that the user should be redirected to, along with the PKCE verifier that should be stored for the token exchange.
func (*Client) SignUp ¶
func (c *Client) SignUp(email, password string, data map[string]interface{}) (*types.SignupResponse, error)
SignUp registers a new user with email and password. Optionally accepts user metadata.
func (*Client) SignUpWithEmailOTP ¶
func (c *Client) SignUpWithEmailOTP(email string, options *SignUpOptions) error
SignUpWithEmailOTP initiates a signup flow using email OTP verification. It sends a one-time password to the user's email.