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

Get a Clics project by ID with the TypeScript SDK

Copy page

Get a project

Fetch a single Clics project by ID with the TypeScript SDK to read name, domain, status, and settings.

Fetches a single project by ID. Use this to read current settings (name, domain, localhost flag, status) before updating or to verify a project exists.

Parameters

Field Required Description
projectId Yes Project ID (e.g. from createProject or listProjects)

Signature

clics.projects.getProject(request, options?)

Example

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

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

const result = await clics.projects.getProject({
  projectId: "proj_xxx",
});

console.log(result.status, result.websiteUrl);

What it returns

A Project object:

{
  id: "proj_xxx",
  name: "Acme Marketing",
  websiteUrl: "example.com",
  allowLocalhost: false,
  status: "active",
  createdAt: 1_754_000_000_000,
}

Use websiteUrl as the site hostname, allowLocalhost to decide whether local tracker traffic is accepted, and status to avoid mutating a project that is being deleted.

Field Description
id Stable Clics project ID used by all project-scoped SDK calls
name Dashboard display name
websiteUrl Normalized primary website hostname
allowLocalhost Whether localhost/development traffic is accepted
status active, deleting, or error
createdAt Creation timestamp

Notes

Returns 404 if the project does not exist or is not in your workspace.

API reference

See Get a project for request and response schemas, status codes, and error types.

Was this page helpful?