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 🙏

© 2025 – Pkg Stats / Ryan Hefner

buildx-connect

v1.0.2

Published

Official JavaScript/TypeScript SDK for Buildx low-code platform

Downloads

23

Readme

Buildx Connect SDK

Official JavaScript/TypeScript SDK for the Buildx low-code platform. Easily integrate Buildx APIs into your Node.js or browser applications with a modular, Firebase-like API.

Table of Contents


Installation

yarn add buildx-connect
# or
npm install buildx-connect

Quick Start

import { Buildx } from 'buildx-connect';

const buildx = new Buildx({
  apiEndpoint: 'https://api.buildx.com',
  apiKey: 'your-api-key',
  projectId: 'your-project-id',
});

// Authenticate
const user = await buildx.auth().login({ username: 'user', password: 'pass' });

// List projects
const projects = await buildx.projects().list();

// Query documents (uses project ID from config)
const docs = await buildx.collections().query('collectionId', { limit: 10 });

Configuration

The SDK is initialized with a configuration object:

const buildx = new Buildx({
  apiEndpoint: 'https://api.buildx.com',
  apiKey: 'your-api-key',
  projectId: 'your-project-id',        // Used as default for all operations
  organizationId?: 'your-org-id',      // Optional, for organization-level operations
});

You can update the configuration at runtime:

buildx.updateConfig({ apiKey: 'new-api-key' });

API Overview

The SDK is organized into modular services, similar to Firebase. All methods use the project ID from your config by default, but you can override it by passing a projectId parameter:

buildx.auth()        // Authentication
buildx.projects()    // Project management
buildx.collections() // Data collections
buildx.storage()     // File storage
buildx.flows()       // Workflow automation
buildx.templates()   // Template rendering

Authentication

// Login (uses project ID from config)
await buildx.auth().login({ username, password });

// Signup (uses project ID from config)
await buildx.auth().signup({ username, password });

// Get current user (uses project ID from config)
await buildx.auth().getCurrentUser();

// Override project ID for specific operation
await buildx.auth().login({ username, password }, 'different-project-id');

Token Management

The SDK automatically stores authentication tokens when you login, signup, or verify OTP. You can also manually manage tokens:

// Check if user is authenticated
const isAuth = buildx.auth().isAuthenticated();

// Get current access token
const token = buildx.auth().getAccessToken();

// Get current refresh token
const refreshToken = buildx.auth().getRefreshToken();

// Manually set tokens
buildx.auth().setAccessToken('your-access-token');
buildx.auth().setRefreshToken('your-refresh-token');

// Clear all stored tokens (logout)
buildx.auth().clearTokens();

// Refresh authentication token
await buildx.auth().refreshToken();

Projects

// List all projects
await buildx.projects().list();

// Get project by ID
await buildx.projects().get('project-id');

// Create a new project
await buildx.projects().create({ name: 'My Project' });

Collections

// List collections (uses project ID from config)
await buildx.collections().list();

// Query documents (uses project ID from config)
await buildx.collections().query('collectionId', { filter: { status: 'active' } });

// Create document (uses project ID from config)
await buildx.collections().createDocument('collectionId', { field: 'value' });

// Override project ID for specific operation
await buildx.collections().query('collectionId', { limit: 10 }, 'different-project-id');

Storage

// Upload a file (uses project ID from config)
await buildx.storage().upload(file, 'uploads/');

// List files (uses project ID from config)
await buildx.storage().list('uploads/');

// Delete a file (uses project ID from config)
await buildx.storage().deleteFile('uploads/file.txt');

Flows

// Get flow types
await buildx.flows().getTypes();

// Run a flow (uses project ID from config)
await buildx.flows().run('flow-id', { args: { foo: 'bar' } });

Templates

// Preview a template (uses project ID from config)
await buildx.templates().preview(template, data);

// Render a template (uses project ID from config)
await buildx.templates().render('template-id', data);

// Generate PDF (uses project ID from config)
await buildx.templates().generatePDF('template-id', data);

TypeScript Support

This SDK is written in TypeScript and ships with full type definitions for all APIs and data models.

Error Handling

All methods return either the expected result or an ErrorResponse object:

interface ErrorResponse {
  error: string;
  message: string;
  statusCode: number;
  success: false;
}

Check for errors in your code:

const result = await buildx.projects().get('project-id');
if ('error' in result) {
  // handle error
  console.error(result.message);
}