# Base

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

---


# Base

Read more about the Base system in Hiro [here](../../concepts/base/).

## Functions

### RateApp

Use the SMTP configuration to send feedback from a player via email.

```go
userId := "userId"
username := "username"
var score uint32 = 5
message := "I love this game!"

err := systems.GetBaseSystem().RateApp(ctx, logger, nk, userId, username, score, message)
if err != nil {
  return err
}
```

### SetDevicePrefs

Set push notification tokens on a user's account so push messages can be received.

```go
userId := "userId"
deviceId := "deviceId"
pushTokenAndroid := "pushTokenAndroid"
pushTokenIos := "pushTokenIOS"
preferences := map[string]bool{} // Used to store device specific parameters.

err := systems.GetBaseSystem().SetDevicePrefs(ctx, logger, db, userId, deviceId, pushTokenAndroid, pushTokenIos, preferences)
if err != nil {
  return err
}
```

### Sync

Manually trigger a sync operation to update the server with offline state changes.

```go
userId := "userId"
req := &hiro.SyncRequest{
  Inventory:         nil,
  Economy:           nil,
  Achievements:      nil,
  Energy:            nil,
  EventLeaderboards: nil,
  Progressions:      nil,
  Stats:             nil,
  Tutorials:         nil,
  Unlockables:       nil,
  Streaks:           nil,
} // Manually update system offline state.

resp, err := systems.GetBaseSystem().Sync(ctx, logger, nk, userId, req)
if err != nil {
  return err
}
```