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() {
  c := NewKratosClient("http://127.0.0.1:4433/")
  ctx := context.Background()
  flowID := "" // Usually something like: res.Request.URL.Query().Get("flow")

  flow, _, err := c.PublicApi.GetSelfServiceRecoveryFlow().Id(flowID).Execute()
  if err != nil {
    // ...
  }

  fmt.Printf("%+v", rs.Payload)
}
