package samples

import (
  "fmt"

  "github.com/ory/kratos-client-go"
)

func NewKratosClient(endpoint string) *kratos.APIClient {
  conf := kratos.NewConfiguration()
  conf.Servers = kratos.ServerConfigurations{{URL: endpoint}}
  return kratos.NewAPIClient(conf)
}

func main() {
  ctx := context.Background()
  flowID := "" // Usually something like: res.Request.URL.Query().Get("flow")

  c := NewKratosClient("http://127.0.0.1:4433/")
  flow, _, err := c.PublicApi.GetSelfServiceRegistrationFlow().Id(flowID).Execute()
  if err != nil {
    // ...
  }

  fmt.Printf("%+v", flow)
}
