Changelog #109

·

Specify columns to exclude from Realtime streams

Eric Allam

Eric Allam

CTO, Trigger.dev

Image for Specify columns to exclude from Realtime streams

We've added support for selective column filtering in Trigger.dev Realtime. You can now specify which columns to exclude from your realtime hooks, giving you more control over what data gets sent to your frontend applications.

Why skip columns?

There are several scenarios where you might want to exclude certain columns from your realtime hooks:

  • Privacy and security: Exclude payloads or outputs that may contain sensitive data
  • Performance optimization: Skip large text fields, binary data, or other heavy columns to reduce bandwidth and improve streaming performance
  • Data filtering: Only stream the specific columns your frontend actually needs, reducing payload size and complexity

How it works

When creating public access tokens or configuring realtime authentication, you can now include a skipColumns array in the realtime property. This will automatically filter out the specified columns from all realtime data streams using that token:


import { auth } from "@trigger.dev/sdk";
const publicAccessToken = await auth.createPublicToken({
realtime: {
skipColumns: ["payload", "output"],
},
});

By tying the skipColumns to a public access token, you can ensure that only the data you want to stream is sent to your frontend applications, and the value of skipColumns cannot be changed after the token is created.

Other columns you may want to skip are:

  • payload - The payload of the run
  • output - The output of the run
  • costInCents - The cost of the run in cents
  • baseCostInCents - The base cost of the run in cents
  • durationMs - The duration of the run in milliseconds
  • tags - The tags of the run

Installation

Make sure you update your @trigger.dev/sdk and trigger.dev CLI packages to the latest beta version 4.0.0-v4-beta.22:


# Install the latest beta version of the SDK and any other @trigger.dev/* packages
pnpm add @trigger.dev/[email protected]
# Use the latest beta version of the CLI

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now