nbp-adapter-google-datastore

0.1.0 • Public • Published

Google Datastore adapter

import googleDatastoreAdapterFactory from 'nbp-adapter-google-datastore';
const datastoreAdapter = googleDatastoreAdapterFactory({
    platform: 'name-of-your-platform',
    projectId: 'google-project-id',
    keyFilename: 'path-to-your-keys-json',
    logger: 'your logger instance'
});

Then you can get a namespaced datastore instance by passing entryId (can be a FB Page ID for example) and senderId (this is user ID):

const datastore = datastoreAdapter({
   entryId: 'fb-page-id',
   senderId: 'user-id'
});

datastore is a usual datastore instance. So you can check docs.

Tunneling

Check tunneling.js. To bind context of all client's function we need to perform tunneling on each request, so inside skills you can do memcached.set('key', 'Some text) without specifying application tokens, with suffixes (platform.entryId.senderId.key) for keys.

Look at router-builder.js as an example.

Readme

Keywords

none

Package Sidebar

Install

npm i nbp-adapter-google-datastore

Weekly Downloads

3

Version

0.1.0

License

ISC

Last publish

Collaborators

  • maxmert