NewWacht Bench is live — AI-assisted development for Wacht

listSegments()

Returns paginated segments with optional search and sorting.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function listSegments() {  const client = await wachtClient();  return client.segments.listSegments({ limit: 20, search: 'beta' });}

Signature

function listSegments(  options?: ListSegmentsOptions,): Promise<PaginatedResponse<Segment>>

ListSegmentsOptions

›
options.limit?: number | undefined;
Maximum page size.
›
options.offset?: number | undefined;
Result offset.
›
options.search?: string | undefined;
Search term by segment name.
›
options.sort_key?: string | undefined;
Sort field.
›
options.sort_order?: string | undefined;
Sort direction.

Return value

›
data?: Segment[] | undefined;
Current page result items.
›
has_more?: boolean | undefined;
Whether additional pages are available.
›
limit?: number | undefined;
Effective page size when returned by backend.
›
offset?: number | undefined;
Effective offset when returned by backend.

Behavior

  • Returns a backend-scoped list response for this resource.
  • Use pagination and filters from this method to build admin list views.

On this page