SDK

@myjsblock/sdk

A guide to start with the MyJSBlock SDK. For a quick introduction we suggest reading our introduction.

Setup your project (e.g. with Vite)​arrow-up-right

We recommend using a build tool like Vitearrow-up-right, it is an easy to use development tool for all kinds of frameworks. It also has support for creating PWAs and more. It is not required, you can also use your own setup.

With npm:

npm create vite

With yarn:

yarn create vite

After a couple of questions Vite will create a starter project for you. If you just want use regular JavaScript you can choose 'vanilla'.

npm install @myjsblock/sdk

yarn add @myjsblock/sdk

Before we begin​arrow-up-right

All the modules the SDK exposes are functions, every function in the SDK returns a promise. If you're not familiar with Javascript Promises checkout this page on MDNarrow-up-right.

Your first function​arrow-up-right

In JavaScript you're able to call functions that will interact with your AppMachine App. Simply import the function and call it.

HTML

JavaScript

See this example on GitHubarrow-up-right.

Publish it with the CLI​arrow-up-right

If you haven't installed the CLI yet, follow the steps in our Getting Started.

Push your project​arrow-up-right

Last updated

Was this helpful?