Pryv.io data store
Library and tools for accessing external data stores within Pryv.io.
⚠️ This is the first public release; the following are still likely to change:
- Code examples
- API documentation
- (For contributors) Development environment
Quick start
To let Pryv.io access an external data store:
Create your data store implementation in Node.js based on the present library
npm install --save @pryv/datastore
- Implement a data store in your package's main module; for example:
const ds = require('@pryv/datastore');
module.exports = ds.createDataStore({
async init (params) {
this.settings = params.settings;
this.streams = ds.createUserStreams({
});
this.events = ds.createUserEvents({
});
return this;
},
async deleteUser (userId) {
},
async getUserStorageSize (userId) {
}
})
For the details, see the API documentation.
Install it on your Pryv.io core machines
- Deploy your module in your chosen location on each core machine
- Register it in platform configuration under key
custom:dataStores
; each data store definition has those properties:
id
(string): The store's id – this is used in data so do not changename
(string): The store's name, for logging and messaging purposessettings
(object): Any settings to pass to your data store implementation
Contributing
Installation
Prerequisites: Node.js 16+, just
Run just
to see the available commands (defined in justfile
), e.g.
just install
to install node modulesjust doc
to regenerate the API documentation
License
BSD-3-Clause