init

Learn how to configure your project.

This command initializes your project to integrate with our SDKs. It provides an interactive walkthrough to configure your organization, workspace, applications, and SDK settings.

Croct's mascot winking
No account required

If you don't have an account yet, the CLI will create one for you during the setup process.

Usage

This command has the following syntax:

croct init <options>

Example

Initialize your project interactively:

npx croct@latest init

Initialize with a specific SDK and skip the API key setup:

npx croct@latest init --sdk next --skip-api-key-setup

Options

Besides the global options, this command accepts the following options:

--override, -o(optional)
boolean

Override any existing configuration.

By default, the CLI does not modify existing configuration files to prevent accidental data loss.

--new, -n(optional)
string

Forces the creation of new remote resources.

By default, the CLI attempts to use existing resources defined in your configuration. Use this flag to ignore existing definitions and provision new entities on the platform instead. For example, if a workspace is already configured, specifying --new workspace will create a brand-new one within your current organization.

ResourceDescription
organization or orgProvision a new organization.
workspace or worProvision a new workspace within the active organization.
application or appProvision a new application within the active workspace.
--sdk, -s(optional)
string

The SDK to use in the project.

By default, the CLI attempts to detect the appropriate SDK based on the project structure. You can use this option to explicitly specify which SDK to configure.

SDKDescription
javascriptConfigure the JavaScript SDK.
reactConfigure the React SDK.
nextConfigure the Next.js SDK.
--skip-api-key-setup(optional)
boolean

Skips the automatic API key generation and configuration.

Some integrations, such as the Next.js SDK, require an API key for server-side features. By default, the CLI generates a key and saves it to your environment variables automatically. Use this flag if you prefer to provision or manage your keys manually.

You can also set this using the CROCT_SKIP_API_KEY_SETUP environment variable.

Default:false
--org(optional)
string

The slug of the organization.

If omitted, the CLI will prompt you to select an organization from your account or create a new one.

--wor(optional)
string

The slug of the workspace.

If omitted, the CLI will prompt you to select a workspace or create a new one.

--dev-app(optional)
string

The slug of the development application.

If omitted, the CLI will prompt you to select an application or create a new one for development.

--prod-app(optional)
string

The slug of the production application.

If omitted, the CLI will prompt you to select an application or create a new one for production.