This project is here to test my pr for a next-auth dynamodb adapter.
I've gone with a single table design. This project is an application of what I'm currently learning with Alex DeBrie's book. If you to learn more about DynamoDB you definitely should take a look at it !
(This schema has an error: verification_reqest have no connection with users, they are a separete entity)You need a table with as partition key pk
and as sort key sk
. Your table also need a global secondary index names GSI1
with GSI1PK
as partition key and GSI1SK
as sorting key. You can set whatever you want as the table name and the billing method.
You need to add these environment variables to a .env.local
file :
GITHUB_ID
Github oauth app idGITHUB_SECRET
Github oauth app secretEMAIL_SERVER
Email serverEMAIL_FROM
Email fromNEXT_AUTH_AWS_ACCESS_KEY
AWS IAM access keyNEXT_AUTH_AWS_SECRET_KEY
AWS IAM secret keyNEXT_AUTH_AWS_REGION
AWS region
Note that Github and Email are only used as providers for testing purpose.
AWS secret start with NEXT_AUTH
in order to not conflict with Vercel's reserved environment variables.
All functions needed for an adapter in Next-Auth have been done. I'm now testing different scenarios to see if everythings work. Also, need to clean the code before PR.
Here is a detailed view of what needs to be done in order to have a working adapter :
- createUser
- getUser
- getUserByEmail
- getUserByProviderAccountId
- updateUser
- deleteUser
- linkAccount
- unlinkAccount
- createSession
- getSession
- updateSession
- deleteSession
- createVerificationRequest
- getVerificationRequest
- deleteVerificationRequest