Talo logoDocsBlog
Back to blog

TypeScript frontend, feedback search, quick updates

2 min read
TypeScript frontend, feedback search, quick updates

We migrated the frontend to TypeScript!

This migration has been a long time coming, and we're thrilled to have finally completed this huge chunk of work.

With TypeScript, not only have we improved the maintainability of the frontend and our ability to build faster and catch bugs earlier, but we've also made a number of improvements focused on observability.

This update (and all the other updates below) is available starting today in the latest version of our frontend package.

Deep dive: Type-safety from backend responses

For Talo, the biggest benefit of this TypeScript migration is being able to add typing to our API responses. We're using Zod to validate responses from the backend against the expected schema. For example, here's how we make a request for the latest events:

const eventsVisualisationPayloadSchema = z.object({
  name: z.string(),
  date: z.number(),
  count: z.number(),
  change: z.number()
})

const fetcher = async ([url]: [string]) => {
  const qs = new URLSearchParams({
    startDate,
    endDate
  }).toString()

  const res = await makeValidatedGetRequest(`${url}?${qs}`, z.object({
    events: z.record(
      z.array(eventsVisualisationPayloadSchema)
    ),
    eventNames: z.array(z.string())
  }))

  return res
}

Using generics and z.infer to output a type from a Zod schema, we're able to use these typed responses to render UI elements. This allows us to also easily type our swr requests and mutators, providing end-to-end type-safety.

Zod is also incredibly helpful for outputting useful error messages when the backend response doesn't match the expected schema. We can then capture these exceptions, ship them off to Sentry and get notified as soon as an error comes in. Here's how we do it:

Feedback service updates: search and filtering

We recently released the Feedback service, allowing your players to submit feedback and allowing you to view and categorise it. We've recently improved the feedback dashboard experience by adding pagination and search functionality.

Now you can search both by comment and also by player. Looking for a specific player's feedback? Just type their username in the search bar and you'll see all their feedback in one place.

Searching and filtering on the Feedback page

Quick updates

We've also spent the last couple of weeks working on a number of smaller updates:

  • You no longer need to create new Access Keys to edit their scopes! You can now update the scopes on an existing key directly in the Talo dashboard. Any updates made to keys are now also reflected on the Game Activity page.
  • We've added a convenient date picker to the Events start + end date filters.
  • We've adopted the Stylistic ESLint plugin to enforce consistent code style across our codebases.

Coming soon

Next up, we're going to be tackling Player Authentication. Currently, Talo relies on you implementing your own login and registration process that you feed into Talo's Player Identification system. In the next release, we'll be adding APIs for registering and authenticating players directly through Talo.

We'll also be making updates to the API to ensure that players requiring authentication are actually authenticated, meaning that they cannot be impersonated in leaderboards or stats.

You can find all the latest progress updates and releases in our Discord.


TudorWritten by Tudor

Build your game faster with Talo

Don't reinvent the wheel. Integrate leaderboards, stats, event tracking and more in minutes.

Using Talo, you can view and manage your players directly from the dashboard. It's free!

Get started

More from the Talo Blog

Exploring Talo’s new Caddy self-hosting template
3 min read

Exploring Talo’s new Caddy self-hosting template

A breakdown of Talo’s latest Caddy-based self-hosting option, plus a look at other self-hosting templates available for your game.

Changelog: group updates + new Godot game save demo
2 min read

Changelog: group updates + new Godot game save demo

All the highlights from Talo’s October 2024 releases across the dashboard, backend, Godot plugin and Unity package.

How to see live online player counts in your Godot game
4 min read

How to see live online player counts in your Godot game

Have you ever wondered how many players are current playing your Godot game? Talo makes it easy to find out using player groups.

How to load and save game state using Godot
5 min read

How to load and save game state using Godot

A quick and easy example of how to use Talo Game Saves to handle saving and loading scenes in your Godot game even when players are offline.