Go SDK
The local Go SDK module is github.com/credvault/credvault-edge-go. It uses Go modules and provides typed resource structs for the main CredVault APIs.
Installation
Use the local source module provided by CredVault, or a private Git repository that contains that module path.
If the module is hosted in your Git provider, install it with:
go get github.com/credvault/credvault-edge-go
If your organization keeps the module in a private Git provider, make sure users have access to that repository before they run go get.
Connecting to CredVault
The SDK defaults to http://localhost:5000/api, which is only for local backend development. Production code must set the CredVault backend API URL on the client.
package main
import (
"fmt"
"os"
credvault "github.com/credvault/credvault-edge-go"
)
func main() {
client := credvault.New(os.Getenv("CREDVAULT_API_KEY"))
client.Client.BaseURL = "https://<your-credvault-backend>/api"
customers, err := client.Data.Query("customers", map[string]string{
"status": "active",
})
if err != nil {
panic(err)
}
fmt.Println(customers)
}
Working with Data
Go methods return a response and an error. Always check the error before using the response.
query := map[string]string{"status": "active"}
customers, err := client.Data.Query("customers", query)
if err != nil {
panic(err)
}
fmt.Println(customers)
Available Resources
Authfor sign-in and sign-upDatafor clusters and collection dataCiefor datasets and predictionsWebhooksfor event deliveryFunctionsfor serverless functionsTriggersfor collection eventsBackupsfor backup and restoreSchemafor schema and indexesApiKeysfor API key managementMetricsfor platform monitoringLogsfor activity and audit logsNotificationsfor notifications; preference methods should be checked against/api-docsSettingsfor account settings, but some methods still need backend route alignmentRobotsfor robot/device endpoints, but this area still needs route alignment before it is public-ready
Security
Load credentials from environment variables or a secrets manager. Do not hardcode keys in Go source files, compiled binaries, or example repositories.