@auth/dynamodb-adapter
Official DynamoDB adapter for Auth.js / NextAuth.js.
Installation
npm install next-auth @auth/dynamodb-adapter
DynamoDBAdapterOptions
Properties
indexName?
optional indexName: string;
indexPartitionKey?
optional indexPartitionKey: string;
indexSortKey?
optional indexSortKey: string;
partitionKey?
optional partitionKey: string;
sortKey?
optional sortKey: string;
tableName?
optional tableName: string;
format
const format: {
from: null | T;
to: Record<string, unknown>;
};
Type declaration
from()
Takes a Dynamo object and returns a plain old JavaScript object
Type parameters
Type parameter | Value |
---|---|
T | Record <string , unknown > |
Parameters
Parameter | Type |
---|---|
object ? | Record <string , any > |
Returns
null
| T
to()
Takes a plain old JavaScript object and turns it into a DynamoDB object
Parameters
Parameter | Type |
---|---|
object | Record <string , any > |
Returns
Record
<string
, unknown
>
DynamoDBAdapter()
DynamoDBAdapter(client, options?): Adapter
Parameters
Parameter | Type |
---|---|
client | DynamoDBDocument |
options ? | DynamoDBAdapterOptions |
Returns
generateUpdateExpression()
generateUpdateExpression(object): {
ExpressionAttributeNames: Record<string, string>;
ExpressionAttributeValues: Record<string, unknown>;
UpdateExpression: string;
}
Parameters
Parameter | Type |
---|---|
object | Record <string , any > |
Returns
{
ExpressionAttributeNames: Record<string, string>;
ExpressionAttributeValues: Record<string, unknown>;
UpdateExpression: string;
}
ExpressionAttributeNames
ExpressionAttributeNames: Record<string, string>;
ExpressionAttributeValues
ExpressionAttributeValues: Record<string, unknown>;
UpdateExpression
UpdateExpression: string;