# First steps

If you've never used the Modyo platform and/or Widgets, we recommend starting with here. In addition, this guide assumes that you have the modyo-cli installed and that you have read its documentation.

API access token

In order to use the Widgets in this catalog, you need to have an API access token that allows you to download them for use. You can get this through your organization or directly with Modyo.

# Start a Widget

The fastest way to start a Widget is to use one of the templates in this Catalog as an accelerator and then modify it to suit your needs. To use one of our templates we will use the GET command in the modyo-cli:

modyo-cli get name-from-Widget nameFolder

For example, if we want to use the Consumer Cred template from People Banking, the command is as follows:

modyo-cli get modyo-widgets-retail-consumer-loan ~/Desktop/MyLoanWidget

And to start the server in development mode:

cd ~/Desktop/MyLoanWidget && yarn serve

# Publish a Widget

To upload our Widget to the platform and publish it, we will use the PUSHcommand of the modyo-cli. This can be done locally or by using continuous integration (recommended).

Before we can load and publish our Widget locally, we must create a .env environment variable file at the root of the project with the following variables:

MODYO_TOKEN=[siteToken]
MODYO_ACCOUNT_URL=[accountUrl]
MODYO_SITE_HOST=[siteHost]
MODYO_WIDGET_NAME=[widgetName]

Follow this guide to get a token that allows us to upload and publish the Widget.

The AccountUrl is the URL of the account that owns the site. The SiteHost can be searched in the Channels —> SiteS section and can be reviewed in the host column of the site list.

Host

With the created .env file and the added values we can load the Widget to our site:

modyo-cli push

Once the loading process is finished, the Widget will be available in theWidgets section of our site waiting to be reviewed and published.

widgets-list

If we want to publish the Widget automatically after loading, we can use the —publish option of the PUSH command.

modyo-cli push --publish