# Using entries

> Learn how to consume entries in compositions, patterns, and custom applications using data resources, APIs, and SDKs.

Source: https://docs.uniform.app/docs/guides/composition/entries/using-entries

Entries are designed to be consumed across multiple touchpoints in your digital experiences. You can integrate entries into compositions, use them in patterns for reusability, or access them directly through APIs and SDKs for custom applications.

This guide covers the different ways to consume and use your entries.

## Using entries in compositions and patterns

The most common way to use entries is by connecting them to your [compositions](https://docs.uniform.app/docs/guides/composition) and [patterns](https://docs.uniform.app/docs/guides/patterns) through [data resources](https://docs.uniform.app/docs/guides/composition/connect-external-data/data-resources). This allows content creators to build experiences visually while leveraging structured content.

To connect entries to compositions or patterns, you need to create a data resource from a `Uniform Content` data type.

### Auto-generated data types

For each content type that has at least one entry, two [data types](https://docs.uniform.app/docs/guides/composition/connect-external-data/data-modeling#configure-data-types) are automatically generated:

1. One for selecting a single entry
2. One for querying multiple entries of the same content type

These autogenerated data types have an `Autogenerated` pill in the listing of data types under **Experience > Data types**. You can modify autogenerated data types like any other data type, but the `Autogenerated` pill will be removed once saved.

![Autogenerated data types for a content type](https://docs.uniform.app/images/guides/composition/entries/autogenerated-content-data-types.png)

### Data type archetypes

You can create additional data types beyond the autogenerated ones. These archetypes are available for `Uniform Content` data sources:

- **Single entry**: Allows you to select a single entry
- **Single entry by slug**: Allows you to select a single entry by its slug, useful with [dynamic routes](https://docs.uniform.app/docs/guides/composition/url-management/routing/dynamic-inputs)
- **Multiple entries**: Allows you to select multiple entries
- **Query entries**: Allows you to query entries based on a set of conditions

![Available archetypes for Uniform Content data types](https://docs.uniform.app/images/guides/composition/entries/content-archetypes.png)

> **Publishing requirements for entries:**
>
> Unless you activate [unpublished content mode](https://docs.uniform.app/docs/guides/composition/connect-external-data/data-modeling#unpublished-content-mode) on your data source, you need to publish new or modified entries to use them in data resources on compositions or component patterns.
>
> - **New entries**: Must be published before they can be selected in data resources
> - **Modified entries**: Must be republished for changes to appear in data resources

### Selecting entries in data resources

When configuring data resources, you can use all search and filter capabilities to find the right entry to select. However, once a selection has been made, this search is not saved with the data resource.

![Select a single entry in a data resource by using search and filter capabilities](https://docs.uniform.app/images/guides/composition/entries/single-entry-data-resource.png)

### Querying entries in data resources

The "Query entries" archetype defines a search query that returns a "live" list of entries matching the query criteria. Unlike static selection archetypes, the search result changes over time when matching entries are added, changed, or removed.

When configuring a "Query entries" data resource, you can use the same search and filter capabilities as when managing entries, plus additional query settings:

- **Search field**: Can be a static value or based on a [dynamic input](https://docs.uniform.app/docs/guides/composition/connect-external-data/data-resources#dynamic-inputs-with-data-resources)
- **Search filters**: Allows static values or dynamic inputs for system properties, entry metadata and custom fields
- **Sort by**: Sort results by system property, entry metadata or custom field (static values or dynamic inputs)
- **Show locale**: Defines which locale entries should be returned in
- **Records to fetch**: Maximum number of entries returned by the query
- **Start from**: Skip records and start at a specific index (useful for pagination)

> **Locale fallbacks for entries:**
>
> You can specify a comma-separated list of locales to act as a fallback chain if the entry doesn't have translations in the specified locale. The first matching locale on an entry will be returned.

![Querying entries in a data resource](https://docs.uniform.app/images/guides/composition/entries/entries-query-data-resource.png)

## Using entries in patterns

Entries can be integrated into all three types of [patterns](https://docs.uniform.app/docs/guides/patterns) in Uniform. A key benefit of using entries in patterns is that the mapping of entry fields to component parameters is pre-configured by content architects. This means content editors only need to select which entry to display without having to worry about how to connect individual entry fields to component parameters.

> **Optimize performance with levels to resolve:**
>
> When configuring data types for entries in patterns, set appropriate [levels to resolve](https://docs.uniform.app/docs/guides/models/content-types/references#resolving-references) to improve performance:
>
> - **Lists of entries**: Use lower levels to resolve (1-2) since only high-level data like titles and summaries are typically displayed
> - **Single entries**: Use deeper levels to resolve (2-3) when more detailed information needs to be shown, such as full content, metadata, or nested references

### Component patterns with entries

[Component patterns](https://docs.uniform.app/docs/guides/patterns/component-patterns) can use entries through [pattern data resources](https://docs.uniform.app/docs/guides/patterns#using-data-resources-with-patterns), allowing you to create reusable components that automatically pull content from your entries. This eliminates the need for content editors to manually configure data mappings for each component instance.

For detailed information on creating and managing component patterns, see the [component patterns guide](https://docs.uniform.app/docs/guides/patterns/component-patterns). For configuration options, refer to [pattern data resources](https://docs.uniform.app/docs/guides/patterns#using-data-resources-with-patterns).

> **Preview entries in different component patterns:**
>
> To see how an entry looks across different component patterns (like a hero or card), create a dynamic composition that includes all relevant patterns. This helps content editors preview their content in various contexts. See the [preview compositions](https://docs.uniform.app/docs/knowledge-base/create-dynamic-preview-compositions-for-component-patterns) article for details.

### Composition patterns with entries

[Composition patterns](https://docs.uniform.app/docs/guides/patterns/composition-patterns) can incorporate entries as data sources for entire page structures. This allows you to:

- **Dynamic compositions**: Create composition patterns with pre-connected entry data for consistent page layouts for dynamic routes
- **Content-driven experiences**: Build composition patterns where the component structure adapts based on entry content and metadata
- **Multi-source integration**: Combine entries with other data sources within a single composition pattern

### Entry patterns with entries

[Entry patterns](https://docs.uniform.app/docs/guides/patterns/entry-patterns) can reference other entries as data sources, enabling content relationships such as:

- **Dynamic content inclusion**: Use entries as data sources to automatically populate common fields across multiple entries
- **Content templates**: Build entry patterns that combine static structure with dynamic entry-based content

### Pattern data resources with entries

When using entries in patterns, you can configure [pattern data resources](https://docs.uniform.app/docs/guides/patterns#using-data-resources-with-patterns) to control how entries are consumed. For detailed configuration options including static references, overridable selection, and optional data resources, see the [pattern data resources documentation](https://docs.uniform.app/docs/guides/patterns#using-data-resources-with-patterns).

## Using entries as data resources in other entries

Content entries can be used as data resources in other entries, allowing you to dynamically include shared field values like product names, pricing, or terms. This is accomplished through dynamic tokens placed in entry fields.

A common use case is to create a **Dictionary term** content type that represents common terms and copy values.

> **Best practices for using entries as data resources in other entries:**
>
> - If you want to define a relationship between entries, use the **References** field type
> - Keep the number of entries used as data resources to a minimum and use the **Single entry** archetype with a low resolution level setting to avoid performance issues
> - Avoid **Multiple entries** and **Query** data types for common copy values, as the index-based referencing system may cause values to be swapped when dynamic tokens are resolved

## Using entries via API or SDK

For custom applications, headless implementations, or when you need programmatic access to your content, you can consume entries directly using Uniform's APIs or SDKs.

### Available APIs

Entries can be accessed via two different Uniform APIs:

**Uniform Edge Delivery API** (Recommended for most applications)

- Used for retrieving entries for delivery purposes
- Runs on the CDN edge for optimal performance
- Supports resolving "edgehanced" values in dynamic tokens
- _For the US region:_

   _For the EU region:_

**Uniform Platform API**

- Used for managing and retrieving entries for management purposes
- Does not support resolving "edgehanced" values in dynamic tokens
- _For the US region:_

   _For the EU region:_

### Using the Content Client SDK

The [Content Client](https://docs.uniform.app/docs/sdk/content-client) (`ContentClient` from `@uniformdev/canvas`) provides a convenient JavaScript/TypeScript interface for accessing entries:

```javascript
import { ContentClient } from '@uniformdev/canvas';

const contentClient = new ContentClient({
   apiKey: process.env.UNIFORM_API_KEY,
   projectId: process.env.UNIFORM_PROJECT_ID,
});

// Fetch 20 recipe entries matching "pizza", newest first
const { entries } = await contentClient.getEntries({
   filters: { type: { eq: 'recipe' } },
   search: 'pizza',
   limit: 20,
   orderBy: 'updated_at_DESC',
});
```

See the [Content Client SDK](https://docs.uniform.app/docs/sdk/content-client) for initialization options (including EU region hosts), the full filter operator reference, and data projection.

This approach gives you full control over how and where your content is used, making it ideal for:

- Building custom frontends or mobile applications
- Integrating content into existing systems
- Creating custom search or filtering experiences
- Feeding content to third-party services
