nbp-adapter-google-datastore
v0.1.0
Published
Google Datastore adapter for Node.js Bot Platform
Downloads
8
Readme
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.