Help us shape the future of Go! Take the 2026 Go Developer Survey

smstwilio

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {
	AccountSID       string
	AuthToken        string
	VerifyServiceSID string
	AppName          string // App name shown in SMS messages (e.g., "MyApp Login")
	Client           *http.Client
}

Sender implements SMS sending using Twilio's Verify API. Uses custom codes generated by authkit for consistency with email verification.

func New

func New(accountSID, authToken, verifyServiceSID, appName string) *Sender

New creates a Twilio SMS sender. All parameters are required. appName is used in SMS messages (e.g., "MyApp Login" or "MyApp Verification")

func (*Sender) SendLoginCode

func (s *Sender) SendLoginCode(ctx context.Context, phone, code string) error

SendLoginCode sends a 2FA login code via Twilio Verify API

func (*Sender) SendVerificationCode

func (s *Sender) SendVerificationCode(ctx context.Context, phone, code string) error

SendVerificationCode sends a 6-digit verification code via Twilio Verify API Uses custom_code to maintain consistency with authkit's code generation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL