Apillon launches platform-specific SDK and CLI to ease development process

The latest addition unlocks readily accessible automation, scripting, automated website deployment, and more.

Apillon launches platform-specific SDK and CLI to ease development process

The Apillon platform is a comprehensive tool that helps developers onboard to Web3 in a few-click fashion without diving deep into the back-end code’s nitty gritty.

But it was not built just for those who want a quick ticket to Web3 (although it gets them there alright). With our peer software developers in mind, we’re also constantly looking for ways to improve their programming experience.

The latest additions to Apillon’s dev toolbox are SDK and CLI. Both currently offer support for the Web3 Storage, Hosting, NFT and IPNS services, and will sustain the Web3 Authentication and upcoming services soon.

Apillon SDK

First, Apillon’s software development kit (SDK) is a collection of platform-specific building tools for developers available in one installable package, which comprises of libraries and tools for interacting with Apillon-provided services.

With Apillon SDK, you’re spared the need to use Apillon’s REST API. You also don’t have to compose boilerplate code. But you do get multi-step flows packed into a single operation.

Apillon SDK on Apillon Wiki

Once you install the Apillon SDK as an .npm library, you can use it for your Web3 project or in your script.

The SDK cuts the need for you to call the Apillon API every time you wish to access the Apillon-provided services. Instead, you can modularly integrate the Apillon services in your Web3 project through coding in TypeScript or JavaScript languages.

Get started with Apillon SDK. 👇

Apillon SDK | Apillon Wiki
Apillon Wiki
☝️ Note: To utilize the Apillon SDK, you need npm 8.4.0 or higher, node.js 16.17.0 or higher, and the Apillon API key and secret.

Apillon SDK example

Apillon SDK consists of different modules depending on which Web3 service you want to use. All modules require the same initial configuration of key and secret.

To illustrate the use of SDK, let’s look at the Storage module, which encloses the functionalities of the Web3 Storage service by Apillon.

import { Storage, LogLevel, FileStatus } from "@apillon/sdk"; 
import * as fs from "fs"; 
 
const storage = new Storage({ 
  key: "yourApiKey", 
  secret: "yourApiSecret", 
  logLevel: LogLevel.NONE, 
}); 
 
// list buckets 
await storage.listBuckets({ limit: 5 }); 
 
// create and instance of a bucket directly through uuid 
const bucket = storage.bucket("uuid"); 
 
// Upload files from local folder 
await bucket.uploadFromFolder("./my-foler/files/"); 
// Or alternatively, send file buffers as upload parameters 
const htmlBuffer = fs.readFileSync("./public/index.html"); 
await bucket.uploadFiles( 
  [ 
    { 
      fileName: "index.html", 
      contentType: "text/html", 
      path: null, 
      content: htmlBuffer, 
    }, 
  ], 
  // Upload the files in a new subdirectory in the bucket instead of in the root of the bucket 
  { wrapWithDirectory: true, directoryPath: "main/subdir" } 
); 
 
// list objects (files, folders) in a bucket 
await bucket.listObjects({ 
  directoryUuid: "eaff2672-3012-46fb-9278-5efacc6cb616", 
  markedForDeletion: false, 
  limit: 5, 
}); 
 
// list all files in a bucket no matter if they are in a folder or not 
await bucket.listFiles({ fileStatus: FileStatus.UPLOADED }); 
 
// gets a specific file in a bucket directly through uuid 
const file = await bucket.file("2195521d-15cc-4f6e-abf2-13866f9c6e03").get(); 
 
// deletes a file via uuid 
await bucket.file("2195521d-15cc-4f6e-abf2-13866f9c6e03").delete(); 
// deletes a directory via uuid 
await bucket.directory("eddc52cf-92d2-436e-b6de-42d7cad621c3").delete();
🔎 To dive deep into the Web3 Storage SDK, including the method, class, and properties, check out Apillon’s SDK Storage documentation.

Apillon CLI

The second addition, Apillon’s command line interface (CLI), allows you to interact with the Apillon API simply by inputting commands into a text-based interface.

Apillon CLI on Apillon Wiki

Install the Apillon CLI. 👇

Apillon CLI | Apillon Wiki
Apillon Wiki
☝️ Note: To install the Apillon CLI, you need Node.js (v16 or later). To use the CLI, you should have an account at Apillon.io and generate an API key for your project.

CLI command example

To illustrate the use of CLI commands, let’s apply them to the context of the NFT service.

In this example, the nfts list-collections command lists all NFT collections owned by a project related to an API key. When paired with --status <3> , where integer 3represents deployed collections, the response is the following. 👇

{ 
  "items": [ 
    { 
      "createTime": "2023-11-20T10:21:12.000Z", 
      "updateTime": "2023-11-20T14:12:33.000Z", 
      "uuid": "2cda3a9b-01b1-4b5e-9709-7087129d55d0", 
      "symbol": "SE", 
      "name": "SpaceExplorers", 
      "description": "A collection of unique space exploration NFTs.", 
      "collectionType": "GENERIC", 
      "maxSupply": 1000, 
      "baseUri": "https://moonbeamnfts.com/collections/spaceexplorers/", 
      "baseExtension": ".json", 
      "isSoulbound": false, 
      "isRevokable": false, 
      "drop": false, 
      "dropPrice": 0.05, 
      "dropStart": 1679875200, 
      "dropReserve": 100, 
      "royaltiesFees": 5, 
      "royaltiesAddress": "0xaz5Bh6E56c5d3B58c944542de2bF18E7F65eED82", 
      "collectionStatus": "TRANSFERRED", 
      "contractAddress": "0x4e22162A6d0c91a088Cb57A72aB976ccA2A96B25", 
      "transactionHash": null, 
      "deployerAddress": "0xba015fgc6d80378a9a95f1687e9960857593983b", 
      "chain": "MOONBASE" 
    } 
  ], 
  "total": 1 
}

Apillon CLI in CI/CD tools

You can also use the Apillon CLI in CI/CD builds and pipelines.

For example, you can leverage it to deploy a website through GitHub Actions. 👇

name: Deploy Website 
 
on: 
  push: 
    branches: 
      - master 
 
jobs: 
  deploy: 
    runs-on: ubuntu-latest 
 
    steps: 
      - name: Checkout repository 
        uses: actions/checkout@v3 
 
      - name: Set up Node.js 
        uses: actions/setup-node@v3 
        with: 
          node-version: 16 
 
      - name: Create dist folder 
        run: mkdir -p dist 
 
      - name: Copy files 
        run: | 
          cp *.html dist/ 
          cp -r images dist/ 
          cp -r style dist/ 
          cp -r js dist/ 
 
      #### 
      ## if you are using a framework for building web app, you can replace previous two step with the 
      ## appropriate command for generating static webpage, like an example bellow. 
      ## Find the correct command in your framework documentation. You may need to to change the 
      ## name of the source folder in the last step (CLI call) 
      #### 
 
      # - name: Build app 
      #   run: npm run build 
 
      - name: Deploy website 
        env: 
          APILLON_API_KEY: ${{ secrets.APILLON_API_KEY }} 
          APILLON_API_SECRET: ${{ secrets.APILLON_API_SECRET }} 
          WEBSITE_UUID: ${{ secrets.WEBSITE_UUID }} 
        run: | 
          npm i -g @apillon/cli 
          apillon hosting deploy-website ./dist --uuid $WEBSITE_UUID --key $APILLON_API_KEY --secret $APILLON_API_SECRET

Enhancing DevX, one line of code at a time

The release of Apillon SDK and CLI unlocks new opportunities for developers and equips them with readily accessible automation, scripting, and automated website deployment through CLI, just to name a few.

While previously, the only (coding) way to integrate and execute Web3 features into your projects was using API keys and secrets, you can now tap into greater development opportunities by simply utilizing commands, libraries and tools.

With new SDK and CLI options, Apillon hopes to turn the speed and quality of releasing new Web3 projects up a notch and tame developers’ daily stress levels. Because even the shortest line of code can go a long way.

Learn more about:


⧓ About Apillon

The Apillon platform serves as a unified gateway to the Web3 services provided by linked Polkadot parachains. Following the multi-chain vision, Apillon powers the transition of developers to Web3, simplifying its adoption in the real economy, and expanding its versatility as the ecosystem grows. With Apillon, Web3 services are within reach for every developer, regardless of their background and experience with blockchain technology.

Website | Wiki | GitHub | Twitter | Discord | LinkedIn | Reddit | Telegram