Installation
To install the ActivitySmith Go SDK, you can usego get:
Go
Usage
- Create an API key
- Pass the API key into
activitysmith.New.
Go
Send a Push Notification
Useactivitysmith.Notifications.Send with an activitysmithsdk.PushNotificationInput.
Go
Start a Live Activity
Start a Live Activity withactivitysmith.LiveActivities.Start.
For segmented_progress, include Title, NumberOfSteps, CurrentStep, and Type.
For progress, set Type: "progress" and add WithPercentage(...) or WithValue(...).WithUpperLimit(...).
Go
Go
Update a Live Activity
Update a Live Activity withactivitysmith.LiveActivities.Update using the activityID.
For progress updates, use WithPercentage(...) or WithValue(...).WithUpperLimit(...) instead of CurrentStep.
Go
Go
End a Live Activity
End a Live Activity withactivitysmith.LiveActivities.End.
If AutoDismissMinutes is omitted, backend default 3 is used.
For progress activities, use WithPercentage(...) or WithValue(...).WithUpperLimit(...).
Go
Go
Channels
You can target specific channels when sending a push or starting a Live Activity.Go
Error Handling
Handle API errors by checking the returnederror from SDK calls.