Skip to main content

How to setup local environment

This document guides you through the installation and basic configuration of components needed to create own capability. So you can publish it or use it locally in your application.

Prerequisites

To install and use Superface CLI, you will need to have installed:

Install the CLI

The Superface CLI is Node.js application. Note that it requires Node.js 12 or higher.

npm install --global @superfaceai/cli

Create a new project

Start with creating a new directory for the project

mkdir my_project

and changing the directory.

cd my_project

Optionally create package.json by running the following command:

npm init

Now initialize Superface local folder structure in the project root.

superface init

It will create superface folder with the below structure

  • grid - folder for storing capabilities and mappings
  • types - folder with generated types
  • super.json - superface configuration file

And as last step install OneSDK.

npm install --save @superfaceai/one-sdk

(Optional) Install the Visual Studio Code extension

You can install the Visual Code Code extension which will give you:

  • Syntax highlighting for Comlink
  • Code snippets

It can be installed from Visual Studio Marketplace.