Skip to content


The Plunk Go SDK is a wrapper around the Plunk API that allows you to easily, and type-safely, interact with the Plunk API from your Go applications.

Source code for the SDK can be found on GitHub (opens in a new tab).


This SDK is endorsed by Plunk, but not made by Plunk. If you have any issues with the SDK, please open an issue on the GitHub repository.


Install the SDK using go get:

go get

Getting Started

Interactions with the Plunk API are made through a client, create one using your secret key.

p, _ := plunk.New("YOUR_API_KEY")

Sending events

Use the TriggerEvent method to send events to Plunk.


  • Event: The name of the event to publish
  • Email: The email address of the user to publish the event to
p, err := New(secretKey, opts)
payload := &EventPayload{
    Event: "new-project",
    Email: "",
resp, err := p.TriggerEvent(payload)

Sending emails

Use the sendTransactionalEmail method to send transactional emails.

  • To: The email address of the recipient
  • Subject: The subject of the email
  • Body: The body of the email (HTML, plain text, or Markdown)
p, err := plunk.New("YOUR_API_KEY", config)
payload := &TransactionalEmailPayload{
    To:      "",
    Subject: "Welcome to Plunk",
    Body:    "<h1>Hello world!</h1>",
response, err := plunk.SendTransactionalEmail(payload)
Last updated on April 21, 2023