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/")

  sessionToken := "..."
  flowID := "" // Usually something like: res.Request.URL.Query().Get("flow")

	ctx := context.WithValue(context.Background(), kratos.ContextAccessToken, sessionToken)
	flow, _, err := c.PublicApi.GetSelfServiceSettingsFlow(ctx).Id(flowID).Execute()
	if err != nil {
	  // ...
	}

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