<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "CKToolJS"
  },
  "title" : "CKTool JS"
}
-->

# CKTool JS

Manage your CloudKit containers and databases from JavaScript.

## Overview

CKTool JS gives you access to features provided in the CloudKit Console API, facilitating CloudKit setup operations for local development and integration testing. It’s a JavaScript client library alternative to the macOS `cktool` command-line utility distributed with Xcode. To learn more about `cktool`, see [Automating CloudKit Development](https://developer.apple.com/icloud/cloudkit/automating/).

With this library, you can:

- Apply a CloudKit schema file to Sandbox databases (for more information about CloudKit schema files, see <doc://com.apple.documentation/documentation/CloudKit/integrating-a-text-based-schema-into-your-workflow>).
- Populate databases with test data.
- Reset Sandbox databases to the production configuration.
- Write scripts for your integration tests to incorporate.

The library consists of three main modules:

- [`CKToolDatabaseModule`](/documentation/CKToolJS/CKToolDatabaseModule): This package contains all the CloudKit related types and methods, operations to fetch teams and containers for the authorized user, and utility functions and types to communicate with the CloudKit servers. This package also contains operations to work with CloudKit records. You include `@apple/cktool.database` as a dependency in your `package.json` file to access this package.
- [`CKToolNodeJsModule`](/documentation/CKToolJS/CKToolNodeJsModule): This package contains a [`createConfiguration`](/documentation/CKToolJS/CKToolNodeJsModule/createConfiguration) function you use in projects intended to run in Node.js. You include `@apple/cktool.target.nodejs` as a dependency in your `package.json` file to access this package.
- [`CKToolBrowserModule`](/documentation/CKToolJS/CKToolBrowserModule): This package contains a [`createConfiguration`](/documentation/CKToolJS/CKToolBrowserModule/createConfiguration) function for use in browser-based projects. You include `@apple/cktool.target.browser` as a dependency in your `package.json` file to access this package.

## Topics

### Essentials

[Integrating CloudKit access into your JavaScript automation scripts](/documentation/CKToolJS/integrating-cloudkit-access-into-your-javascript-automation-scripts)

Configure your JavaScript project to use CKTool JS.

### Promises API

[`PromisesApi`](/documentation/CKToolJS/PromisesApi)

A class that exposes promise-based functions for interacting with the API.

[`CancellablePromise`](/documentation/CKToolJS/CancellablePromise)

A promise that has a function to cancel its operation.

[`CKToolDatabaseModule`](/documentation/CKToolJS/CKToolDatabaseModule)

The imported package that provides access to CloudKit containers and databases.

### Configuration

[`Configuration`](/documentation/CKToolJS/Configuration)

An object you use to hold options for communicating with the API server.

[`CKToolNodeJsModule`](/documentation/CKToolJS/CKToolNodeJsModule)

The imported package that supports using the client library within a Node.js environment.

[`CKToolBrowserModule`](/documentation/CKToolJS/CKToolBrowserModule)

The imported package that supports using the client library within a web browser.

### Global Structures and Enumerations

[`Container`](/documentation/CKToolJS/Container)

Details about a CloudKit container.

[`ContainersResponse`](/documentation/CKToolJS/ContainersResponse)

An object that represents results of fetching multiple CloudKit containers.

[`CKEnvironment`](/documentation/CKToolJS/CKEnvironment)

An enumeration of container environments.

[`ContainersSortByField`](/documentation/CKToolJS/ContainersSortByField)

An enumeration that indicates sorting options for retrieved containers.

[`SortDirection`](/documentation/CKToolJS/SortDirection)

An enumeration that indicates sorting direction when applying a custom sort.

### Errors

[`ErrorBase`](/documentation/CKToolJS/ErrorBase)

The base class of any error emitted by functions in the client library.

[Database, Length, Validation, and Value Errors](/documentation/CKToolJS/database-length-validation-and-value-errors)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)