Triplit adds a JSON attribute type
TLDR
Triplit adds support for arbitrary JSON attributes, revamps Cloudflare Workers support, and improves documentation.
New type unlocked: JSON
A much-requested feature is finally here: Triplit now supports a JSON type for attributes. This allows you to store arbitrary JSON data in your documents, making it easier to work with complex heterogenous data structures. You can define a JSON attribute in your schema like this:
import { Schema as S } from '@triplit/client';
const schema = S.Collections({
documents: {
schema: S.Schema({
id: S.Id(),
title: S.String(),
content: S.String(),
metadata: S.JSON(), // New JSON type
}),
},
});
The value stored in the metadata
attribute can be any valid JSON object or primitive, including nested objects and arrays. Furthermore, you can write queries that filter based on the contents of the JSON object. For example, you can query for documents where the metadata
attribute contains a specific key or value:
const query = triplit
.query('documents')
.Where('metadata.last_updated', '>', '2025-05-01');
In the case of heterogenous data, Triplit will automatically handle undefined values and coercing values at the same key with disparate types. Read more about the JSON type in the documentation.
Restored and improved support for Cloudflare Workers
With the release of Triplit 1.0 and the corresponding change to Triplit's storage format we temporarily removed support for Cloudflare Workers. We are happy to announce that we have restored support for Cloudflare Workers, backed by Durable Objects. This means you can now deploy your Triplit applications on Cloudflare Workers, taking advantage of their global network and easy-to-deploy serverless framework. In revitalizing this support, we have made improvements to the performance of Triplit on Cloudflare Workers by using the most up-to-date features of Durable Objects.
Read the documentation for more information on how to deploy your Triplit application on Cloudflare Workers.
Multiple docs updates
We've made several updates to our documentation to improve clarity and usability. This includes:
- Information on the supported filter operators (.e.g
=
,!=
,>
,<
,>=
,<=
,in
,not in
,like
,nlike
) has been moved to the filtering documentation and expanded. - More detailed descriptions of the various types that Triplit schemas support and their configuration options.
- LLM-friendly docs endpoints including
- a plaintext
/docs/llms.txt
page that contains descriptions and links to every page in the documentation, which an LLM can use to understand the structure of the documentation and navigate it. e.g./docs/sitemap.txt
. - a
.md
page for every documentation page that strips out the layout and other components, making it easier to parse and understand the content. e.g./docs/query/where.md
- a
/docs/llms-full.txt
endpoint that aggregates every documentation page into a single markdown file, for "fine-tuning" LLMs on the entirety of Triplit's documentation.
- a plaintext
- We've added a section on Triplit's supported runtimes to help you choose the best environment for your application. At this time, that includes the browser and Hermes JavaScript engine for the frontend, and Node.js and Cloudflare Workers for the backend.
Other improvements
- New
MAX_BODY_SIZE
environment variable to limit the size of the body in HTTP requests. This limit often comes into play when doing a large bulk insert or seed operation. The default value is 100MB, but it can be raised or lowered as needed. - Improved performance for many queries, but especially those with nested inclusions, by reducing unnecessary data transformation in the query engine.