# Tutorials

**URL:** https://heroiclabs.com/docs/hiro/server-framework/tutorials/
**Keywords:** tutorials, hiro
**Categories:** hiro, tutorials, server-framework

---


# Tutorials

Read more about the Tutorials system in Hiro [here](../../concepts/tutorials/).

## Functions

### Get

Get all tutorials defined and progress made by the user towards them.

```go
userId := "userId"

tutorials, err := systems.GetTutorialsSystem().Get(ctx, logger, nk, userId)
if err != nil {
  return err
}
```

### Accept

Mark a tutorial as accepted by the user.

```go
tutorialId := "tutorialId"
userId := "userId"

tutorial, err := systems.GetTutorialsSystem().Accept(ctx, logger, nk, tutorialId, userId)
if err != nil {
  return err
}
```

### Decline

Mark a tutorial as declined by the user.

```go
tutorialId := "tutorialId"
userId := "userId"

tutorial, err := systems.GetTutorialsSystem().Decline(ctx, logger, nk, tutorialId, userId)
if err != nil {
  return err
}
```

### Abandon

Mark a tutorial as abandoned by the user.

```go
tutorialId := "tutorialId"
userId := "userId"

tutorial, err := systems.GetTutorialsSystem().Abandon(ctx, logger, nk, tutorialId, userId)
if err != nil {
  return err
}
```

### Update

Modify a tutorial's current step for a user.

```go
userId := "userId"
tutorialId := "tutorialId"
step := 2

tutorials, err := systems.GetTutorialsSystem().Update(ctx, logger, nk, userId, tutorialId, step)
if err != nil {
  return err
}
```

### Reset

Reset all known state for the given tutorial(s).

```go
userId := "userId"
tutorialIds := []string{"tutorialId_001", "tutorialId_002"}

tutorials, err := systems.GetTutorialsSystem().Reset(ctx, logger, nk, userId, tutorialIds)
if err != nil {
  return err
}
```

## Hooks

### SetOnStepCompleted

```go
systems.GetTutorialsSystem().SetOnStepCompleted(OnStepCompleted)

func OnStepCompleted(func(ctx, logger, nk, userID, tutorialID string, config, resetCount, step, prevStep)){
  // Take additional actions.
  return nil
}
```