{"id":19700522,"url":"https://github.com/draftbit/hapi-airtable-authentication-plugin","last_synced_at":"2025-10-23T14:33:31.571Z","repository":{"id":57109597,"uuid":"149508402","full_name":"draftbit/hapi-airtable-authentication-plugin","owner":"draftbit","description":"A plugin that adds JWT-based authentication to a Hapi server, utlizing Airtable as a data store","archived":false,"fork":false,"pushed_at":"2018-10-22T14:24:09.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-08T16:30:01.342Z","etag":null,"topics":["airtable","hapijs","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/draftbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-19T20:27:53.000Z","updated_at":"2021-09-23T20:26:10.000Z","dependencies_parsed_at":"2022-08-20T17:41:01.760Z","dependency_job_id":null,"html_url":"https://github.com/draftbit/hapi-airtable-authentication-plugin","commit_stats":null,"previous_names":["preposterous/hapi-airtable-authentication-plugin"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Fhapi-airtable-authentication-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Fhapi-airtable-authentication-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Fhapi-airtable-authentication-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Fhapi-airtable-authentication-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draftbit","download_url":"https://codeload.github.com/draftbit/hapi-airtable-authentication-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224175730,"owners_count":17268390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtable","hapijs","nodejs"],"created_at":"2024-11-11T21:06:19.206Z","updated_at":"2025-10-23T14:33:31.395Z","avatar_url":"https://github.com/draftbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hapi Airtable Authentication Plugin\n\nA plugin that adds JWT-based authentication to a Hapi server, utilizing Airtable as a data store. It will trigger a callback function with a verification callback url that can be used to send an email with a \"magic link\" style confirmation button.\n\n## Usage\n\nRegister the plugin with your Hapi server by doing the following:\n\n```\nawait server.register({\n  plugin: require(\"@draftbit/hapi-airtable-authentication-plugin\"),\n  options: {\n    airtableBase: AIRTABLE_BASE,\n    airtableApiToken: AIRTABLE_API_TOKEN,\n    jwtSecret: JWT_SECRET,\n    apiUrl: API_URL,\n    verifyCallback: ({ email, verificationUrl, loginCode }) =\u003e {}\n  }\n});\n```\n\nIn Airtable, you must have a table called `Users`, with the following columns:\n\n- `email`, of type Email\n- `login_code`, of type Single line text\n- `email_confirmed`, of type Checkbox\n\nThe following three routes will be added to your server:\n\n- `/verify` - Generates a JWT token and triggers the first step in the authentication process, calling `verifyCallback`. The following query parameters are required:\n  - email - The email address of the authenticating user\n  - linkingUri - The linking URI the user will be redirected to after sign in confirmation.\n- `/confirm` - The route hit when the user navigates to the `verificationUrl` passed in `verifyCallback`. The user will be redirected to the `linkingUri` passed in the previous step, along with `userId` and `token` query params. The following query parameters are required, and are already included in the `verificationUrl` returned in the previous step:\n  - `token`\n  - `linkingUri`\n- `/confirm-code` - This endpoint exists to support the user manually entering the five digit code returned in `verifyCallback`, rather than clicking the \"magic link\" sent in the email. The following query paramters are required:\n  - `email` - The user's email address\n  - `code` - The five digit code returned in `verifyCallback`\n\n## Options\n\nAll options are required.\n\n- `airtableBase` - The ID of the Airtable Base you wish to interact with\n- `airtableApiToken` - Your Airtable API key\n- `jwtSecret` - A string containing the secret for the HMAC algorithm. [See jsonwebtoken docs](https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback) for more information\n- `apiUrl` - The URL that the Hapi server is public accessible from. This will be used to generate the callback URL\n- `verifyCallbacak` - A function that accepts an object with `email`, `verificationUrl`, and `loginCode` keys. This is called after `/verify` is called\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraftbit%2Fhapi-airtable-authentication-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdraftbit%2Fhapi-airtable-authentication-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraftbit%2Fhapi-airtable-authentication-plugin/lists"}