First Steps
This SDK is a Work In Progress! All features are subject to change.
First Steps
The NubeSDK contains the typescript definitions of the types required for development.
Installation
npm
$ npm install -D @tiendanube/nube-sdk-types
yarn
$ yarn add -D @tiendanube/nube-sdk-types
Usage
import { NubeSDK, NubeSDKState } from "@tiendanube/nube-sdk-types";
Creation a of a new application script from scratch
Creating a new application script from scratch that uses nube-sdk is really simple thanks to our existing application template .
Download the application template located in https://github.com/TiendaNube/nube-sdk/tree/alpha/examples/minimal
Copy that template to your own folder
Go into your own folder
Run
npm install
oryarn install
to install the dependenciesRun
npm run build
oryarn build
to build the example application
The provided example already contains all the tooling required, including tsup
, a simplified bundler used to package all the source code files into a single minified file.
After performing these steps, you will have the output of the compilation available in a single file located in dist/main.min.js
You can create your own project / tooling using this sample project as a reference.
Adding script to your application
Adding the script to your application has the same process that with any other script, the only difference is that you have to enable the Uses Nube SDK
flag in the script creation screen, otherwise it will loaded as a classic script and it will fail to work as expected.
Next Steps
- Learn more about Script Structure