Skip to content
Clics privacy-friendly cookieless web analytics documentation
Esc
navigateopen⌘Jpreview
On this page

List Clics projects with the TypeScript SDK

Copy page

List projects

List all projects in your Clics workspace with the TypeScript SDK, including pagination with cursor and limit.

Returns every project in your workspace. Use this to discover project IDs, build admin dashboards, or iterate over sites in automation scripts.

Results are paginated. Pass the cursor from a previous response to fetch the next page.

Parameters

Field Required Description
cursor No Pagination cursor from a prior meta.cursor
limit No Page size (1–100). Omit for the default page size

Signature

clics.projects.listProjects(request?, options?)

Example

import { Clics } from "@clicsdev/sdk";

const clics = new Clics({
  apiKey: process.env.CLICS_API_KEY!,
});

const result = await clics.projects.listProjects({
  cursor: "eyJwayI6InByb2pfMSJ9",
  limit: 20,
});

for (const project of result.projects) {
  console.log(project.id, project.name);
}

if (!result.meta.isDone) {
  const next = await clics.projects.listProjects({
    cursor: result.meta.cursor!,
  });
}

What it returns

Each item in projects has the same fields as getProject:

Field Description
id Stable project ID
name Dashboard display name
websiteUrl Primary hostname
allowLocalhost Whether localhost traffic is accepted
status active, deleting, or error
createdAt Creation timestamp
{
  projects: Project[];
  meta: {
    cursor: string | null; // pass to the next request; null at the end
    isDone: boolean;
  };
}

An empty projects array with isDone: true means the workspace has no projects, not an error.

API reference

See List projects for request and response schemas, status codes, and error types.

Was this page helpful?