Installation
Install the ActivitySmith Go SDK withgo get:
Go
Usage
- Create an API key
- Pass the API key into
activitysmithsdk.New. - Reuse the client anywhere you send pushes or Live Activity updates.
Go
Send a Push Notification
Useactivitysmith.Notifications.Send when a deploy finishes, a customer upgrades, or a background job needs attention.
Go
Rich Push Notifications with Media
Go
What will work:
- direct image URL:
.jpg,.png,.gif, etc. - direct audio file URL:
.mp3,.m4a, etc. - direct video file URL:
.mp4,.mov, etc. - URL that responds with a proper media
Content-Type, even if the path has no extension
Media can be combined with Redirection, but not with Actions.
Actionable Push Notifications
Push notification redirection and actions are optional and can be used to redirect the user to a specific URL when they tap the notification or to trigger a specific action when they long-press the notification. Webhooks are executed by ActivitySmith backend.
Go
Live Activities

metrics: best for live operational stats like server CPU and memory, queue depth, or replica lagsegmented_progress: best for step-based workflows like deployments, backups, and ETL pipelinesprogress: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
Simple: Let ActivitySmith manage the Live Activity for you
Use a stablestreamKey to identify the system or workflow you are tracking,
such as a server, deployment, build pipeline, cron job, or charging session.
This is especially useful for cron jobs and other scheduled tasks where you do
not want to store activityID between runs.
Metrics

Segmented progress

Progress

Stream(...) again with the same streamKey whenever the state changes.
End a stream
Use this when the tracked process is finished and you no longer want the Live Activity on devices.content_state is optional here; include it if you want
to end the stream with a final state.
Stream(...) request with the same streamKey,
ActivitySmith starts a new Live Activity for that stream again.
Stream responses include an Operation field:
started: ActivitySmith started a new Live Activity for thisstreamKeyupdated: ActivitySmith updated the current Live Activityrotated: ActivitySmith ended the previous Live Activity and started a new onenoop: the incoming state matched the current state, so no update was sentpaused: the stream is paused, so no Live Activity was started or updatedended: returned byEndStream(...)after the stream is ended
Advanced: Full lifecycle control
Use these methods when you want to manage the Live Activity lifecycle yourself:- Call
activitysmith.LiveActivities.Start(...). - Save the returned
activityID. - Call
activitysmith.LiveActivities.Update(...)as progress changes. - Call
activitysmith.LiveActivities.End(...)when the work is finished.
Metrics Type
Usemetrics when you want to keep a small set of live stats visible, such as
server health, queue pressure, or database load.
Start

Update

End

Segmented Progress Type
Usesegmented_progress for jobs and workflows that move through clear steps or
phases. It fits jobs like backups, deployments, ETL pipelines, and checklists.
NumberOfSteps is dynamic, so you can increase or decrease it later if the
workflow changes.
Start

Update

End

Progress Type
Useprogress when the state is naturally continuous. It fits charging,
downloads, sync jobs, uploads, timers, and any flow where a percentage or
numeric range is the clearest signal.
Start

Update

End

Live Activity Action
Just like Actionable Push Notifications, Live Activities can have a button that opens provided URL in a browser or triggers a webhook. Webhooks are executed by the ActivitySmith backend.
Open URL action
Go
Webhook action
Go
Channels
Target specific channels when sending a push or starting a Live Activity.Go
Error Handling
SDK calls returnresponse, err, so check err after every call.
Additional Resources
Source Code
View the Go SDK source on GitHub