1.17.0-pre.20250521.2 • Published 10 months ago

@smapiot/piral-cloud-node v1.17.0-pre.20250521.2

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Piral Logo

@smapiot/piral-cloud-node

Node-usable API Client for the Piral Feed Service.

This package is compatible with Node.js v12 or higher.

Important Links

  • 📢 We are hiring! - work with us on Piral, its ecosystem and our users
  • 🌍 Website - learn more about the Piral Feed Service
  • 📖 Documentation - everything to get started and master the Piral Feed Service
  • 👪 Community Chat - ask questions and provide answers in our Gitter room

Installation

The package can be installed with your favorite npm client, e.g.:

npm i @smapiot/piral-cloud-node

Once installed the package is ready to be used.

Usage

To use the package you need to import the createServiceClient function and call it:

const { createServiceClient } = require('@smapiot/piral-cloud-node');

const client = createServiceClient({
  apiKey: '123...',
});

// use the client

If you want to use it with your own Piral Feed Service instance then provide the host option:

const { createServiceClient } = require('@smapiot/piral-cloud-node');

const client = createServiceClient({
  apiKey: '123...',
  host: 'http://localhost:9000',
});

// use the client

Example

If you want to just manipulate a feed you can go ahead and use the doUpdateFeed function.

const { createServiceClient } = require('@smapiot/piral-cloud-node');

const client = createServiceClient({
  apiKey: '123...',
});

const feedId = 'my-feed';

console.log('Before', await client.doQueryFeed(feedId));

await client.doUpdateFeed(feedId, {
  contributors: ['a@b.com', 'c@d.com'],
});

console.log('After', await client.doQueryFeed(feedId));

Everything is fully typed using TypeScript declarations.

License

This SDK is released using the MIT license. For more information see the license file.

1.16.3

10 months ago

1.16.2

10 months ago

1.16.1

11 months ago

1.16.0

1 year ago

1.16.4

10 months ago

1.14.1

2 years ago

1.14.0

2 years ago

1.15.0

2 years ago

1.13.6

2 years ago

1.13.5

2 years ago

1.13.4

2 years ago

1.13.3

2 years ago

1.13.2

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

0.17.0

3 years ago

0.18.0

2 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.2

3 years ago

0.14.3

3 years ago

0.14.4

3 years ago

0.14.1

3 years ago

0.13.3

3 years ago

0.13.1

3 years ago

0.13.2

3 years ago

0.13.0

3 years ago

0.12.4

4 years ago

0.12.3

4 years ago

0.12.2

4 years ago