UNPKG

@canva/create-app

Version:

A command line tool for creating Canva Apps.

151 lines (97 loc) 4.2 kB
> [!WARNING] > > ## Deprecation Notice > > If you enjoy @canva/create-app, we have good news! All the functionality (and way more!) is now available in [@canva/cli](https://www.npmjs.com/package/@canva/cli). This package will no longer be updated, so please switch to > stay up-to-date with security and bug fixes, as well as new feature. # @canva/create-app CLI for setting up the boilerplate of a Canva App. ![](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB) ![](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white) ## Table of contents - [Introduction](#introduction) - [Features](#features) - [Usage](#usage) - [CLI reference](#cli-reference) - [Arguments](#arguments) - [Flags](#flags) - [Commands](#commands) - [Next steps](#next-steps) - [Limitations](#limitations) - [Contributing](#contributing) - [License](#license) ## Introduction `@canva/create-app` is a CLI for setting up the boilerplate of a Canva App. It's the best way to get an app up and running in a matter of seconds. To learn more about developing apps, see [the official documentation](https://www.canva.dev/docs/apps). ## Features - Set up a dev environment with Canva's recommended tooling. - Choose from various templates as a starting point for the app. - Get a random development tip for working with the Apps SDk. ## Usage Run the following command: ```bash npx @canva/create-app@latest ``` You'll be asked to complete a series of interactive prompts. A directory for the project will then be created in the current directory. The name of the directory will be derived from the name of the app — for example, "My Cool App" becomes `my-cool-app`. To skip the interactive prompts, pass in the relevant arguments and flags: ```bash npx @canva/create-app@latest "My Cool App" --template="hello_world" --git --installDependencies ``` ## CLI reference ### Arguments #### `[name]` Sets the app's name. ```bash npx @canva/create-app@latest "My Cool App" ``` ### Flags #### `--template` Specifies the template to use as a starting point for the app. The available templates include: - `"hello_world"`: A basic template that provides a minimal starting point. - `"dam"`: A template for integrating with digital asset management applications. - `"gen_ai"`: A template for creating generative AI apps. ```bash npx @canva/create-app@latest --template="hello_world" ``` #### `--git` Initializes a Git repository in the project directory. ```bash npx @canva/create-app@latest --git # npx @canva/create-app@latest --git=false ``` #### `--installDependencies` Automatically installs the project's dependencies with npm. ```bash npx @canva/create-app@latest --installDependencies # npx @canva/create-app@latest --installDependencies=false ``` #### `--lite` Activates a simplified CLI version to enhance accessibility. ```bash npx @canva/create-app@latest --lite ``` #### `--version` Displays the CLI’s current version. ```bash npx @canva/create-app@latest --version ``` #### `--help` Provides usage information about the CLI. ```bash npx @canva/create-app@latest --help ``` ### Commands #### `tip` Displays a random tip for developing apps with the Apps SDK. This command is not compatible with the flags. ```bash npx @canva/create-app@latest tip ``` ## Next steps - [Set up an app via the Developer Portal](https://www.canva.dev/docs/apps/creating-apps/) - [Preview the app in the Canva editor](https://www.canva.dev/docs/apps/previewing-apps/) - [Use the Apps SDK to integrate with Canva](https://www.canva.dev/docs/apps/integrating-canva/) ## Limitations - For the time being, the CLI does not integrate with Canva's [Developer Portal](https://www.canva.com/developers/apps). You still have to manually create and otherwise configure the app via the Developer Portal. ## Contributing We're actively developing this package but are not currently accepting third-party contributions. If you'd like to request any changes or additions to the package, submit a feature request via the [Canva Developers Community](https://community.canva.dev/). ## License See the `LICENSE.md` file.