How to set up the SDK

Estimated tutorial time: 15 minutes

You can access the SDK here: https://github.com/Otomatorg/otomato-sdk

Let’s first generate an auth token

Navigate to: https://otomato-dev-portal.netlify.app/

  • Connect with a wallet - not social login, as you’ll be blocked at a later stage.

  • Please note that you will be asked to sign a blind message. We unfortunately don't have any control on that (Thirdweb’s ERC4337 is the issue). If you are not comfortable with signing a blind message, you can create a new wallet without any funds on it. It is going to work.

You will then see a page similar to this one. You can copy your auth token.

Setting up the SDK

Now that we have an auth token, we can clone the sdk:

git clone <https://github.com/Otomatorg/otomato-sdk>
cd otomato-sdk
npm i

Then, create a .env with those information:

API_URL=https://api.otomato.xyz/api
AUTH_TOKEN=eyJhbGciOiJFUzI1Ni... //replace with your auth token

Running a workflow

We’ll now run a workflow that sends you an email when the WETH balance of 0xEaFB04B5d4fB753c32DBb2eC32B3bF7CdC7f5144 is above 10 WETH.

  • Navigate to examples/Chains/oasis-weth-balance-trigger.ts and put your email.

  • now, run: npm run build; node dist/examples/Chains/oasis-weth-balance-trigger.js

The wallet currently owns more than 10 WETH, which means the workflow will be triggered instantly & you will receive an email a few seconds after having created the workflow.

Now, if we put 12 as a comparison value:

The workflow will be actively monitoring the balance & will wait for the condition to be true to send you an email.

Seeing the execution history in the otomato app

This is quite useful to debug Please note that you can also access all those information via the API (SDK integration coming soon)

Navigate to https://app.otomato.xyz

Connect with the same wallet you used for the dev page. (you don’t need to enter the code & can connect directly, as you’re already registered).

Click on Automation Builder > Execution history

You will then see your two workflows, with one that was executed successfully & one that is still monitoring the balance.

Last updated