https://github.com/bububa/creem-go
creem.io golang SDK
https://github.com/bububa/creem-go
Last synced: 9 months ago
JSON representation
creem.io golang SDK
- Host: GitHub
- URL: https://github.com/bububa/creem-go
- Owner: bububa
- License: apache-2.0
- Created: 2025-07-18T10:49:12.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-18T10:58:44.000Z (11 months ago)
- Last Synced: 2025-07-18T14:44:21.323Z (11 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# creem-go creem.io SDK implementation in Golang
[](https://pkg.go.dev/github.com/bububa/creem-go)
[](https://github.com/bububa/creem-go/actions/workflows/go.yml)
[](https://github.com/bububa/creem-go/actions/workflows/goreleaser.yml)
[](https://github.com/bububa/creem-go)
[](https://goreportcard.com/report/github.com/bububa/creem-go)
[](https://github.com/bububa/creem-go/blob/master/LICENSE)
[](https://gitHub.com/bububa/creem-go/releases/)
## Installation
```bash
go install github.com/bububa/creem-go
```
## Usage
### Create Checkout Session
```golang
import (
"github.com/bububa/creem-go"
"github.com/bububa/creem-go/checkouts"
)
func main() {
clt := creem.New(os.Getenv("CREEM_KEY"))
req := checkouts.CreateRequest {
ProductID: "xxx",
}
var ret checkouts.Checkout
if err := checkouts.Create(context.Background(), &req, &ret); err != nil {
panic(err)
}
fmt.Println(ret)
}
```
### Get Checkout Session
```golang
import (
"github.com/bububa/creem-go"
"github.com/bububa/creem-go/checkouts"
)
func main() {
clt := creem.New(os.Getenv("CREEM_KEY"))
checkoutID := "xxx"
var ret checkouts.Checkout
if err := checkouts.Get(context.Background(), checkoutID, &ret); err != nil {
panic(err)
}
fmt.Println(ret)
}
```
### Webhook
```golang
package main
import (
"fmt"
"net/http"
"github.com/bububa/creem-go/webhooks"
)
func eventHanderl(ctx context.Context, ev *webhooks.Event) error {
fmt.Prinf("EVENT: %+v\n", ev)
return nil
}
func main() {
handler := webhooks.NewHandler(os.Getenv("CREEM_KEY"), eventHandler)
http.HandleFunc("/", handler.ServeHTTP)
port := ":8080"
fmt.Printf("Starting server on http://localhost%s\n", port)
if err := http.ListenAndServe(port, nil); err != nil {
panic(err)
}
}
```
For more details please check in pkg.go.dev