npm.io
0.0.10 • Published 4 years ago

next-auth-adapter-airtable

Licence
MIT
Version
0.0.10
Deps
3
Size
67 kB
Vulns
0
Weekly
0
Stars
3

Airtable Next Auth Adapter

This is a next-auth database adapter for Airtable

Status

This is experimental. Use at your own risk. I've tested this with Google and Email providers. If you run across a configuration that doesn't work, open an issue here with your [...nextauth].js file.

There is test coverage using the standard basic-tests.ts set used for the adapters in the official repo.

Airtable schema

Clone this base in Airtable: https://airtable.com/shr16Xd8glUk90c4P

ENV vars

Add your apiKey and the baseId of the cloned base to .env:

AIRTABLE_API_KEY=keyXXXXXXXXXXXXXX // From your account page
AIRTABLE_BASE_ID=appXXXXXXXXXXXXXX // e.g. https://airtable.com/baseId/something/somethingelse/

Usage

import NextAuth from 'next-auth'
import AirtableAdapter from 'next-auth-adapter-airtable'

export default NextAuth({
  providers: [
    ...providers
  ],
  adapter: AirtableAdapter({
    apiKey: process.env.AIRTABLE_API_KEY,
    baseId: process.env.AIRTABLE_BASE_ID,
  }),
})

Keywords