Registry / database / stentor-user-storage-dynamo

stentor-user-storage-dynamo

JSON →
library1.72.4jsnpmunverified

Provides a DynamoDB-backed user storage implementation for the Stentor conversational AI framework. Version 1.72.4 supports Node 12+ and ships TypeScript types. It is part of the Stentor ecosystem, designed for persisting user session data in AWS DynamoDB with minimal configuration via environment variables. Compared to other storage backends, it integrates tightly with Stentor models and is intended for serverless or containerized deployments. Release cadence is frequent (weekly/monthly minor releases).

npm install stentor-user-storage-dynamo
INSTALL
IMPORT
SIG · STENTOR-USER-STORA
S
stentor-user-storage-dynamo
databasejavascriptv1.72.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

UserStorage
import { UserStorage } from 'stentor-user-storage-dynamo'
import UserStorage from 'stentor-user-storage-dynamo'
Named export, not default.
UserStorageDynamoDB
import { UserStorageDynamoDB } from 'stentor-user-storage-dynamo'
const { UserStorageDynamoDB } = require('stentor-user-storage-dynamo')
CommonJS works but ESM is preferred for bundlers.
DynamoDBStorage
import { DynamoDBStorage } from 'stentor-user-storage-dynamo'
Also exported as alias for UserStorageDynamoDB.

Initializes DynamoDB storage client with a DynamoDBClient, then demonstrates get and update operations on user storage.

import { UserStorageDynamoDB } from 'stentor-user-storage-dynamo'; import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; const client = new DynamoDBClient({ region: 'us-east-1' }); const storage = new UserStorageDynamoDB(client, { tableName: process.env.USER_STORAGE_TABLE ?? 'stentor-user-storage', }); // Example: get user data by userId const userId = 'user123'; storage.get(userId).then((data) => { console.log('User data:', data); }).catch((err) => { console.error('Error fetching user data:', err); }); // Example: update user data const updateData = { lastSession: new Date().toISOString() }; storage.update(userId, updateData).then(() => { console.log('User data updated'); });
Debug
Known issues
gotchaRequires either aws-sdk v2 or @aws-sdk/client-dynamodb v3 as peer dependency, but not both; mixing may cause conflicts.
fix
Install exactly one: npm install @aws-sdk/client-dynamodb or npm install aws-sdk
affects: >=1.0.0
deprecatedEnvironment variable STUDIO_APP_ID is referenced but may be deprecated in favor of configuration objects.
fix
Use constructor options instead of relying on env vars.
affects: >=1.60.0
gotchaThe default table name must be set via USER_STORAGE_TABLE environment variable; missing env var will cause runtime errors.
fix
Set USER_STORAGE_TABLE env var or pass tableName explicitly in options.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'TableName' of 'options' as it is undefined.
Missing or invalid table name configuration.
fix
Ensure USER_STORAGE_TABLE is set or pass tableName in the constructor options.
Class constructor UserStorageDynamoDB cannot be invoked without 'new'
Using the constructor as a regular function without 'new' (common in CommonJS).
fix
Use new UserStorageDynamoDB(client, options).
ValidationException: The provided key element does not match the schema
Table schema mismatch: storage expects partition key 'userId' but the DynamoDB table has a different key.
fix
Create DynamoDB table with partition key 'userId' (string).
Upgrade
Version history
1.72.4latest on npm
Audit
Dependencies
@aws-sdk/lib-dynamodbrequiredDynamoDB client library (v3 SDK) - peer dependency
aws-sdkoptionalDynamoDB client library (v2 SDK) - peer dependency. Either v2 or v3 is required.
stentor-modelsrequiredCore Stentor model types and interfaces
Agent activity
20 hits · last 30 days
node
16
Meta
2
Amazon
1
OpenAI (training)
1
Resources
stentor-user-storage-dynamo — npm install stentor-user-storage-dynamo · libregistry