Go
Go SDK
Install and start using the official context-aware Insion Go client
The official Insion Go SDK lets Go services moderate content, ingest records, manage users, and submit appeals without constructing HTTP requests. This guide walks you through adding the module, creating an authenticated client, and sending a record for immediate moderation.
Before you begin
You'll need:
- An Insion account.
- An API key from the Developer section of your dashboard.
- A Go project using modules.
Use immediate moderation when your application needs a decision in the current request. Use ingestion when moderation can happen asynchronously and your application receives the result through a webhook.
Install
go get github.com/insion-co/goMake your first request
import (
"context"
insion "github.com/insion-co/go"
"github.com/insion-co/go/client"
"github.com/insion-co/go/option"
)
api := client.NewClient(option.WithToken("<token>"))
result, err := api.ModerateARecord(context.Background(), &insion.ModerateRequest{
ClientID: "post-123", Name: "Welcome post", Entity: "post",
Content: &insion.Content{String: "Hello world"},
})Every operation accepts a context.Context and returns a typed response plus error.
Next steps
- Fine-tune client and request behavior in Configuration.
- Explore every supported request and response in Operations.
- Prepare production error handling with Errors.
Get Involved
How is this guide?