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

Update a Clics project with the TypeScript SDK

Copy page

Update a project

Update a Clics project with the TypeScript SDK: rename, change domain, or enable localhost analytics.

Updates one or more project fields. This is a partial update: include only the fields you want to change.

Common reasons to update: rename a project, change the primary domain, or enable localhost tracking for development.

Parameters

Field Required Description
projectId Yes Project to update
body.name No New display name
body.websiteUrl No New primary domain
body.allowLocalhost No Enable or disable localhost traffic

Signature

clics.projects.updateProject(request, options?)

Example

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

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

const result = await clics.projects.updateProject({
  projectId: "proj_xxx",
  body: {
    name: "Acme Marketing",
    websiteUrl: "example.com",
    allowLocalhost: true,
  },
});

What it returns

The complete project after the update, including fields that were not changed in the request.

Field Type Description
id string Stable Clics project ID
name string Current display name
websiteUrl string Current normalized primary hostname
allowLocalhost boolean Current localhost-traffic setting
status "active" | "deleting" | "error" Current lifecycle status
createdAt number Original creation timestamp; it does not change on update
console.log(result.id, result.websiteUrl, result.allowLocalhost);

Notes

  • Cannot update projects with status: "deleting"
  • Changing websiteUrl does not affect historical analytics, it updates how the project is labeled going forward

API reference

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

Was this page helpful?