@knetik/micro-credentials_store-s3

This package provides a simple key value store using amazon aws' s3 service to the [micro-core](https://www.npmjs.com/package/@knetik/micro-core) multi tenant framework.

Stats

StarsIssuesVersionUpdatedCreatedSize
@knetik/micro-credentials_store-s3
3.1.1a month ago4 years agoMinified + gzip package size for @knetik/micro-credentials_store-s3 in KB

Readme

Knetik Micro Credentials Store: S3

This package provides a simple key value store using amazon aws' s3 service to the micro-core multi tenant framework.

Setup the Credentials Store

// config/environments/env.json

{
  "CREDENTIALS_STORAGE_PROVIDER": "s3",
  "S3_CREDENTIALS_STORE_BUCKET": "micro-credentials-store",
  "AWS_PROFILE": "...",
}

2 contextualized stores are made available.

  • Core.CredentialsStore
  • App.CredentialsStore

Methods

On init the Core object will be assigned a credential store instance exposing three functions get, set, remove

Core.CredentialsStore.set('token', '123123').then(token => token);
Core.CredentialsStore.get('token').then(token => token /* 123123 */);
Core.CredentialsStore.remove('token');

On Core connect, the returned App instance will also be assigned a store instance but scoped to the app_id

App.CredentialsStore.set('token', '321321').then(token => token);
App.CredentialsStore.get('token').then(token => token /* 321321 */);
App.CredentialsStore.remove('token');

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.