- Go module: github.com/MailGlyph/mailglyph-go
- GitHub repository: MailGlyph Go SDK
Prerequisites
Before you start, make sure you have:- A MailGlyph secret API key (
sk_...) for server-side API requests - A MailGlyph public API key (
pk_...) for event tracking (/v1/track) - At least one verified sending domain for email sending
Install
Initialize clients (mailglyph.New)
Create one SDK client for your secret key and one for your public key:
Initialize with alias (mailglyph.NewClient)
NewClient is an alias for New.
Configure base URL and timeout (mailglyph.WithBaseURL, mailglyph.WithTimeout)
Use this when testing against staging or local environments:
Use a custom HTTP client (mailglyph.WithHTTPClient)
Key usage rules
The Go SDK enforces key restrictions automatically:pk_*keys can only callEvents.Tracksk_*keys can call non-track endpoints, includingEvents.GetNamesandEvents.ListNames
keyType property on the client.

