autohub-client

1.0.1 • Public • Published

AutoHub Client

Client for the autohub key-value store.

Usage

const { connect } = require('autohub-client');

// Initialize the client
const client = connect({
  baseUrl: 'https://your-autohub-server.com',
  token: 'your-auth-token',
});

// Upsert data to a collection
async function example() {
  try {
    const result = await client.upsert({
      scope: 'users',
      rows: [
        { id: 1, name: 'John Doe', email: 'john@example.com' },
        { id: 2, name: 'Jane Smith', email: 'jane@example.com' },
      ],
    });
    console.log('Upsert successful:', result);
  } catch (error) {
    console.error('Error:', error.message);
    if (error.status) {
      console.error('Status:', error.status);
    }
    if (error.text) {
      console.error('Response:', error.text);
    }
  }
}

Development

  1. Clone the repository:
git clone <repository-url>
cd autohub-client
  1. Install dependencies:
npm install
  1. Set up Git hooks (automatically done during installation):
npm run prepare

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i autohub-client

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

4.87 kB

Total Files

8

Last publish

Collaborators

  • joshwnj