Starting an eCommerce project should be simple, so we created a command line tool that does all the grunt work for you.


The Chec CLI

https://github.com/chec/cli

Simply install globally using NPM

npm install -g @chec/cli

When you're new to Commerce.js and Chec, you might find it helpful to just have a play around with a site that already has products, carts, and checkouts. The CLI can get you started in minutes.

First, create an account:

~ chec register This will open the Chec registration page in your browser Press any key to continue or q to exit:

The registration process involves opening a web browser to register your account with Chec. You’ll need to enter basic details about you as a merchant—the storefront that will be selling your products.

Next, use the chec demo-store command to quickly spin up a new store. This command will seed some data into your Chec account, so make sure this won't affect any other integrations you might already have with the Chec API.

When you run the command, you can choose from a list of examples that we have using some of the various JavaScript libraries that are popular.

Once this command finishes downloading and setting up your store, you should be ready to go! Each store might have a slightly different development process, but the demo should be ready to view and edit locally on your machine. Have fun hacking!

The source code for these example sites is public. When you install the demo, the CLI will inform you where the source was downloaded from.

At Chec, we're always looking for awesome examples of storefronts using our API. If you have an example that you would love to share with us, get in touch.

Other uses for the Chec CLI

In addition to using our CLI to quickly create demo stores, we have two other features that we think will make working with Chec and Commerce.js a little bit easier.

Make API requests without having to worry about authentication

Once you've registered or logged into your Chec account using the CLI, requests using the CLI means you don't have to worry about remembering to pass through your API keys, just specify the request method, the endpoint, and any request payload and the CLI takes care of the rest!

~ chec request GET /v1/developer/user
{
"email": "guy@chec.io",
"created_at": "2019-08-28 11:05:24",
"merchants": [
{
"id": 16595,
"business_name": "Acme, Inc.",
"business_description": "Helping a coyote with his bird problem",
"status": "active",
"timezone": "UT8",
"country": "US",
"currency": { "symbol": "$", "code": "USD" }
}
]
}

Follow a live feed of API requests that Chec is handling

Chec tracks a couple of weeks worth of history of the failed API requests for each merchant. When you're working on an integration with Chec's API, or a customer is having an issue with your site that you can't reproduce, watching the logs for any failures can be incredibly helpful to track down bugs. You can familiarise yourself with the watching logs on the CLI by using the in-built documentation in the CLI:

chec logs --help

Did this answer your question?