Skip to content

evilai/nbp-adapter-google-datastore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Google Storage adapter for Node.js Bot Platform

Resources

Stars

Watchers

Forks

Packages

No packages published