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 API integration, so that you can publish it, or use it locally in your application.

Prerequisites

To install and use Superface CLI, you will need to have installed Node.js version 12 or higher, and npm.

Install the CLI

The Superface CLI is a Node.js application. It provides all the tooling needed to author and manage your integrations with Superface.

npm install --global @superfaceai/cli@3

Create a new project

note

If you have OpenAPI specification of the API you want to integrate you can use Interactive designer to bootstrap the project.

Start with creating a new directory for the project

mkdir my_project
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 superface configuration file super.json.

And as last step install OneSDK.

npm install --save @superfaceai/one-sdk@2

(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.