nextauthjs / nextauthjs/next-auth

Creating an Appwrite Adapter

Open
#7,709 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement triage
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Description 📓

An adapter for appwrite that would basically allow users to interact with appwrite's database.

Here is the documentation for interacting with appwrite's database using its SDK:
https://appwrite.io/docs/client/databases?sdk=web-default#databases

Here is a basic example of an ansynchronous getUser function that can be implemented:

async getUser(sessionToken) {
return 💚
}

Reference on creating a custom adapter for Nextauthjs :
https://next-auth.js.org/adapters/overview#custom-adapter

How to reproduce ☕️

Purpose of the feature is to allow interaction of user data from/to appwrite database. Basically the features of an adapter.

Here are some key features and methods typically found in an adapter for NextAuth.js:

For example:

getUser(id: string): Retrieves a user from the database based on the provided user ID.
getUserByEmail(email: string): Retrieves a user from the database based on the provided email address.
createUser(user: Omit<AdapterUser, "id">): Creates a new user in the database with the provided user data.
updateUser(user: AdapterUser): Updates an existing user in the database with the provided user data.
deleteUser(id: string): Deletes a user from the database based on the provided user ID.

Refer to the docs for more info.

Contributing 🙌🏽

Yes, I am willing to help implement this feature in a PR

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NextAuth.js custom adapter overview and Appwrite database SDK documentation linked in the issue. Use the listed adapter methods—getUser, getUserByEmail, createUser, updateUser, and deleteUser—as the scope, then verify that user data can be read, created, updated, and deleted through Appwrite while following the project’s adapter conventions.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, typescript
Domain
authentication, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.