Zero's frequently asked questions

Learn how to use Zero in a few minutes

What's Zero?

Zero is a board builder. Each board is composed by a group of block. You can build almost any time of dashboard with Zero. Boards work great on smartphones & computers!

How does Zero work?

Zero doesn't rely on existing integration. Instead allows you to write little scripts to fetch & send data. These scripts are written in Javascript and even though it might sound complicated it's actually very simple. We have a section with several examples on our homepage have a look at those. Once you understand how to build a block you can start to group them in different boards and build something which is truly yours.

With Zero you could build:

  • A board to track your users
  • A board to manage orders & refunds
  • A board to track revenue & churn

... really, there is no limit of what you could build!

How to fetch and posting data

In each script you have access to an api() function. This function is an instance of axios. You can use all axios methods and options, for example use:

// Get some data
const {data} = await api.get('https://example.com')
// Post some data
const {data} = await api.post('https://example.com', {hello:"world"})
// Post with basic auth
const {data} = await api.post('https://example.com', {hello:"world"}, {auth:{username:'me', password:'secret'}})

We use const {data} = but you can of course also use const response = and then return response.data

How to access a private endpoint

Private endpoints can be accessed via 3 ways depending on their authentication. Always save private keys in your board settings in the secrets section and use them in your script as secrets.name:

  • Basic Auth:

    const {data} = await api.post(
        'https://example.com', 
        {hello:"world"}, 
        {auth:{username:'me', password:secrets.password_name}}
    )
    
  • Bearer Token

    const {data} = await api.post(
        'https://example.com', 
        {hello:"world"}, 
        {headers: { Authorization: "Bearer " + secrets.token_name } }
    )
    
  • API key in the query

    const {data} = await api.post(
        'https://example.com', 
        {hello:"world"}, 
        {params: { api_key: secrets.token_name } }
    )
    

How to log data?

You can use console.log() to log data inside your scripts

What are script variables?

Each script has one or more variables inside, for example:

const api = require('axios')
const get_data = async (secrets) => {

}

This is the get_data script. Is used to fetch data, as you can see it has only one variable secrets - This is an object which contains all your board api_keys which you have added on the board settings. Remember: always add your secrets & API keys in the board settings apposite section, not as plain text inside your scripts.

You can always check what variables you can use at the bottom of each script in the "variables" tab.

How does caching work?

Most likely you don't want to hit your APIs every time you open your board. Zero has a caching system built in. At the bottom of each script you can select for how long you want to save the response before hitting your API endpoint again.

That's is!

That's pretty much everything. If you have any question please get in touch! P.s. remember to have a look at our examples

Last Updated: April 8, 2021

Need Help?

Have a look at the docs or the examples above

Questions?

Chat with us or leave a message below