1.2.4 • Published 2 years ago

seamless-cloud v1.2.4

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
2 years ago

Seamless.cloud JS Client

This JS client is for Node.js and is currently SERVER-SIDE ONLY.

PLEASE don't use this client-side. You don't want to leak your API key and let any rando run SQL queries against your database...

Install

Install with NPM or Yarn:

npm i seamless-cloud

Usage

You must initialize the SeamlessClient class with a SeamlessClientConfig object, and a fetch function to use. Specifying this function yourself keeps this client portable across server and client applications.

import { SeamlessClient, sql } from 'seamless-cloud';

const client = new SeamlessClient(
  {
    account: 'accountUsername',
    project: 'project-name',
    apiKey: 'my-api-key-here',
  },
  fetch
);

Once initialized, you can now run queries using the sql helper (imported from seamless-cloud):

const authorId = 1;
const results = await client.query(sql`SELECT * FROM posts WHERE authorId = ${authorId} LIMIT 20`);
1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago