{"id":18514195,"url":"https://github.com/tizz98/magicbell-go","last_synced_at":"2025-10-31T20:30:36.796Z","repository":{"id":54573215,"uuid":"336858742","full_name":"tizz98/magicbell-go","owner":"tizz98","description":"Unofficial Go API Library for MagicBell","archived":false,"fork":false,"pushed_at":"2021-02-09T22:39:18.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-25T21:25:40.524Z","etag":null,"topics":["golang","golang-api","magicbell"],"latest_commit_sha":null,"homepage":"https://www.magicbell.com/docs","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tizz98.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["tizz98"]}},"created_at":"2021-02-07T18:25:34.000Z","updated_at":"2022-11-08T17:22:22.000Z","dependencies_parsed_at":"2022-08-13T20:10:28.937Z","dependency_job_id":null,"html_url":"https://github.com/tizz98/magicbell-go","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizz98%2Fmagicbell-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizz98%2Fmagicbell-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizz98%2Fmagicbell-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizz98%2Fmagicbell-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tizz98","download_url":"https://codeload.github.com/tizz98/magicbell-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239231112,"owners_count":19603988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","golang-api","magicbell"],"created_at":"2024-11-06T15:42:20.719Z","updated_at":"2025-10-31T20:30:36.742Z","avatar_url":"https://github.com/tizz98.png","language":"Go","funding_links":["https://github.com/sponsors/tizz98"],"categories":[],"sub_categories":[],"readme":"# magicbell-go: Unofficial Go API Library for MagicBell\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/tizz98/magicbell-go.svg)](https://pkg.go.dev/github.com/tizz98/magicbell-go)\n[`mbctl`](#mbctl-cli-installation)\n\n**This is still a work in progress, expect breaking changes until v1.0.0**\n\n## What is MagicBell?\n\nSee https://magicbell.io/.\n\n## Library Installation\n\n```bash\ngo get -u github.com/tizz98/magicbell-go\n```\n\n## Library Usage\n\n### Send Notification\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tizz98/magicbell-go\"\n)\n\nfunc main() {\n\tmagicbell.Init(magicbell.Config{\n\t\tAPIKey:    \"my-key\",\n\t\tAPISecret: \"my-secret\",\n\t})\n\n\tnotification, _ := magicbell.CreateNotification(magicbell.CreateNotificationRequest{\n\t\tTitle: \"Welcome to MagicBell\",\n\t\tRecipients: []magicbell.NotificationRecipient{\n\t\t\t{Email: \"hana@magicbell.io\"},\n\t\t\t{ExternalID: \"some-id\"},\n        },\n\t\tContent: \"The notification inbox for your product. Get started in minutes.\",\n\t\tCustomAttributes: map[string]interface{}{\n\t\t\t\"order\": map[string]string{\n\t\t\t\t\"id\": \"1234567\",\n\t\t\t\t\"title\": \"A title you can use in your templates\",\n\t\t\t},\n\t\t},\n\t\tActionURL: \"https://developer.magicbell.io\",\n\t\tCategory:  \"new_message\",\n\t})\n\tfmt.Printf(\"Created notification %s\\n\", notification.ID)\n}\n```\n\n### Create user\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/tizz98/magicbell-go\"\n)\n\nfunc main() {\n\tmagicbell.Init(magicbell.Config{\n\t\tAPIKey:    \"my-key\",\n\t\tAPISecret: \"my-secret\",\n\t})\n\n\tuser, _ := magicbell.CreateUser(magicbell.CreateUserRequest{\n\t\tExternalID: \"56780\",\n\t\tEmail:      \"hana@magicbell.io\",\n\t\tFirstName:  \"Hana\",\n\t\tLastName:   \"Mohan\",\n\t\tCustomAttributes: map[string]interface{}{\n\t\t\t\"plan\":              \"enterprise\",\n\t\t\t\"pricing_version\":   \"v10\",\n\t\t\t\"preferred_pronoun\": \"She\",\n\t\t},\n\t})\n\n\tfmt.Printf(\"%#v\\n\", user)\n}\n```\n\n\n## `mbctl` CLI Installation\n\nDownload the latest release for your OS from https://github.com/tizz98/magicbell-go/releases \nand add the binary to your `PATH`.\n\n## `mbctl` CLI Usage\n\n```bash\nmbctl --version\nmbctl --help\n```\n\n### Initialize Config\n\nThis will save your API key and API secret in a `config.yaml` file.\n\n```bash\nmbctl config init\n```\n\n### Notification Commands\n\nCommands related to Notifications.\n\n#### Create Notification\n\nSend a notification to a set of users. Separate multiple recipients with a comma.\nAny string with an `@` will be considered an email address and sent to the API in that field.\n\n```bash\nmbctl notifications create \\\n  --title=\"CLI test\" \\\n  --recipients hana@magicbell.io,foo@example.com,my-external-id \\\n  --content=\"Notification content\" \\\n  --action-url https://google.com \\\n  --category new_message\n```\n\n### User Commands\n\nCommands related to Users.\n\n#### Generate HMAC\n\nGenerate and return a base64-encoded HMAC signature of the provided email.\nThe HMAC key is the API secret.\n\n```bash\nmbctl users generate-hmac hana@magicbell.io\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizz98%2Fmagicbell-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftizz98%2Fmagicbell-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizz98%2Fmagicbell-go/lists"}