Go SDK
Official Go SDK for the soft.house API.
Go SDK โ Not Yet Available. The github.com/soft-house/sdk-go package does not exist. This page shows the planned API design for reference only. The Go SDK has no timeline โ integrate using the REST API directly or wait for the TypeScript SDK (Sprint 58).
Planned Installation
# Not yet published โ will 404
go get github.com/soft-house/sdk-go
Planned Requirements: Go 1.21+
Planned API Design
package main
import (
"context"
"fmt"
"log"
softhouse "github.com/soft-house/sdk-go"
)
func main() {
client := softhouse.NewClient("sk_live_...")
wish, err := client.Wishes.Create(context.Background(), &softhouse.WishCreateParams{
Query: "Find me a laptop under $1500",
Budget: &softhouse.Budget{Max: 1500, Currency: "USD"},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Wish ID: %s, Status: %s\n", wish.ID, wish.Status)
}
Configuration
client := softhouse.NewClient(
"sk_live_...",
softhouse.WithBaseURL("https://api.soft.house"),
softhouse.WithTimeout(30 * time.Second),
softhouse.WithRetries(3),
)
Resources
Wishes
// Create
wish, _ := client.Wishes.Create(ctx, &softhouse.WishCreateParams{
Query: "Find me headphones",
Budget: &softhouse.Budget{Max: 200},
})
// List
wishes, _ := client.Wishes.List(ctx, &softhouse.WishListParams{
Status: "active",
Limit: 10,
})
// Get
wish, _ := client.Wishes.Get(ctx, "wish_abc123")
// Delete
_ = client.Wishes.Delete(ctx, "wish_abc123")
Mandates
mandate, _ := client.Mandates.Create(ctx, &softhouse.MandateCreateParams{
Type: "intent",
ProtocolType: "ap2",
MaxAmount: 1500,
})
Error Handling
wish, err := client.Wishes.Create(ctx, params)
if err != nil {
var apiErr *softhouse.Error
if errors.As(err, &apiErr) {
fmt.Printf("Code: %s\n", apiErr.Code)
fmt.Printf("Status: %d\n", apiErr.StatusCode)
fmt.Printf("Request ID: %s\n", apiErr.RequestID)
}
}
Status: This entire page is a design preview. The
github.com/soft-house/sdk-gopackage is not published and has no scheduled release date. Use the REST API directly until the Go SDK is announced.