npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

architect-node-sdk

v0.0.9

Published

Essentialz Architect Nodejs SDK

Downloads

16

Readme

Architect SDK

Overview

We developed Node.js SDK library in order to make it easier to use Architect services. The library should spare your time and effort, so you can focus on building great apps and beautiful UIs. You can read bellow how easy it is to use.

Getting started

Installation

Using npm

npm install architect-node-sdk

Or using yarn

yarn add architect-node-sdk

Usage

JavaScript

import client from 'architect-node-sdk';

const architect = client({
    baseUrl: 'https://example.essentialz.cloud',            // Your project url
    developerKey: 'a36632cc-d6c5-4535-8051-56325bd1ed59',   // Project developer key
});

Typescript

If you use typescript, you would probably like to define your schema of resources. This will give you full autocomplete support in your IDE for all resources you define.

import client, { ArchitectResource } from 'architect-node-sdk';

type ArchitectSchema = {
    cats: ArchitectResource,
    dogs: ArchitectResource,
    birds: ArchitectResource,
}

const architect = client<ArchitectSchema>({
    baseUrl: 'https://example.essentialz.cloud',            // Your project url
    developerKey: 'a36632cc-d6c5-4535-8051-56325bd1ed59',   // Project developer key
});

Options

When you create architect instance using architect(config: ArchitectConfig): ArchitectSDK function you should provide the following configurations:

| Parameter | Required/Optional | Type | Default | Description | |-------------------|-------------------|-----------|----------|--------------------------------------------------------------------------------------------------------------------------------------| | baseUrl | required | string | | Absolute url to your project domain. | | developerKey | required | string | | Developer key related to your project. | | recommendedCase | optional | boolean | true | Defines whether the SDK will convert names of properties from camelCase to snake_case before sending and after receiving them. |

API reference

Managing resources

There is no limit how a resource can be named as long the name isn't one of reserved words.

You can call it whatever you like and architect SDK will provide you methods for CRUD actions on it. We recommend using plural nouns for resource names.

To access these you should simply call architect.<resource-name> and it will return you a service with the following methods:

  • Fetching all resources:

    getAll(options?: Options): Promise<ArchitectResource[]>

    Options:

    | Parameter | Required/Optional | Type | Default value | Description | |--------------|-------------------|----------|---------------|----------------------------------------------------------------------------------------------------------------------| | authKey | optional | string | | Auth token of an authenticated project user. | | perPage | optional | number | 20 | Number of records that will be returned by API, maximum value is 100. | | lastReadId | optional | string | | Id of last fetched record, used for fetching the next page. If no value is provided API will return first n records. |

  • Fetching a single resource:

    get(resourceId: string, options?: Options): Promise<ArchitectResource>

  • Creating a resource:

    create(resourceData: Record<String, any>, options?: Options): Promise<ArchitectResource>

  • Updating a resource:

    update(resourceId: string, resourceData: Record<String, any>, options?: Options): Promise<ArchitectResource>

  • Deleting a resource:

    delete(resourceId: string, options?: Options): Promise<boolean>

Currently, ArchitectResource is equivalent to Record<string, any> but in the future it will contain many useful utilities.

Options for all methods except getAll is equivalent to { authKey?: string } where authKey is auth token of an authenticated project user.

Example usage

Here is the example how you can manage books resource using SDK.

// This will return all books
const allBooks = await architect.books.getAll();

// This will return single book with id = '5';
const specialBook = await architect.books.get('5');

// Create a new book
const newBook = await architect.books.create({
  name: 'The Adventures of Tom Sawyer',
  author: 'Mark Twain',
});

// Update book with id = '5'
const updatedBook = await architect.books.update('5', {
  numberOfPages: 366
});

// Delete book with id = '5'
await architect.books.delete('5');

Reserved names

The following words cannot be used as resource name.

  • users - reserved for project user resource.
  • files - reserved for the service which is used for managing files.

Managing files

Architect SDK comes with files service for managing files. It contains the following methods:

  • Single file upload

    upload(file: File, options?: Options): Promise<ArchitectFileResource>

  • Bulk upload

    uploadBulk(files: File[], options?: Options): Promise<ArchitectFileResource[]>

Currently, ArchitectFileResource is equivalent to { url: string }.

Options for all methods except getAll is equivalent to { authKey?: string } where authKey is auth token of an authenticated project user.

Example usage

architect.files.upload(file)
  .then((file) => {
      // Manage uploaded file
      // { url: ''}
  })
  .catch((error) => {
      // Handle upload error
  });
architect.files.uploadBulk(files)
  .then((files) => {
      // Manage uploaded files
      // [{ url: ''}, { url: ''}, ...]
  })
  .catch((error) => {
      // Handle upload error
  });

Authentication

You can do all the actions on resources and files as an authenticated project user.

All you should do is to simply provide authKey that belongs to a project user, as option of resource/file action.

For example:

await architect.books.create({ ...newBookData }, { authKey: 'example-auth-key' });