{"id":41081,"library":"fayda","title":"Fayda — Better Auth Plugin for Ethiopian National ID OAuth2","description":"Better Auth plugin integrating Fayda (Ethiopian national digital ID) OAuth2 authentication. Current stable version is 0.0.14, released with monthly cadence. It provides client ID and private key configuration, automatic account linking via better-auth, and requires proper redirect URL setup. Key differentiator: bridges Ethiopian national ID system with the better-auth ecosystem, enabling domestic authentication flows. Requires better-auth ^1.3.4 as a peer dependency.","status":"active","version":"0.0.14","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","batter-auth","fayda","national-id","typescript"],"install":[{"cmd":"npm install fayda","lang":"bash","label":"npm"},{"cmd":"yarn add fayda","lang":"bash","label":"yarn"},{"cmd":"pnpm add fayda","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin registration and OAuth flow","package":"better-auth","optional":false}],"imports":[{"note":"Named import only; default export is not available.","wrong":"import fayda from 'fayda'","symbol":"fayda","correct":"import { fayda } from 'fayda'"},{"note":"CJS pattern requires destructuring.","wrong":"const fayda = require('fayda')","symbol":"fayda (require)","correct":"const { fayda } = require('fayda')"},{"note":"Used on the client side; must be imported from the client plugins path.","wrong":null,"symbol":"genericOAuthClient","correct":"import { genericOAuthClient } from 'better-auth/client/plugins'"}],"quickstart":{"code":"import { fayda } from 'fayda';\nimport { betterAuth } from 'better-auth';\n\nexport const auth = betterAuth({\n  plugins: [\n    fayda({\n      clientId: process.env.FAYDA_CLIENT_ID ?? '',\n      privateKey: process.env.FAYDA_PRIVATE_KEY ?? '',\n    })\n  ],\n  account: {\n    accountLinking: {\n      enabled: true,\n      trustedProviders: ['fayda']\n    }\n  }\n});\n\n// Client-side (Svelte example)\nimport { createAuthClient } from 'better-auth/svelte';\nimport { genericOAuthClient } from 'better-auth/client/plugins';\n\nexport const authClient = createAuthClient({\n  baseURL: 'http://localhost:3000',\n  plugins: [genericOAuthClient()]\n});\n\n// Sign in\nauthClient.signIn.oauth2({ providerId: 'fayda' });","lang":"typescript","description":"Configures better-auth with the Fayda plugin, sets up client-side OAuth, and triggers sign-in flow."},"warnings":[{"fix":"Configure your Fayda client's redirectURL to exactly your base URL plus `/api/auth/oauth2/callback/fayda`.","message":"redirectURL must be set to <baseUrl>/api/auth/oauth2/callback/fayda in Fayda dashboard; otherwise authentication will fail.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Implement a server-side redirect (e.g., SvelteKit endpoint) that forwards callbacks to the correct better-auth handler.","message":"Development callback URLs cannot be used directly; a redirector is required.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Use named import: import { fayda } from 'fayda' instead of import fayda from 'fayda'.","message":"Using default export import pattern is deprecated; only named export is supported.","severity":"deprecated","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.14':25 '1.3.4':72 'account':39 'auth':3,11,44,62,71,80 'authent':20,66 'automat':38 'batter':79 'batter-auth':78 'better':2,10,43,61,70 'better-auth':42,60,69 'bridg':53 'cadenc':29 'client':32 'configur':37 'current':21 'depend':76 'differenti':52 'digit':17 'domest':65 'ecosystem':63 'enabl':64 'ethiopian':6,15,54 'fayda':1,14,81 'flow':67 'id':8,18,33,56,84 'integr':13 'javascript':77 'key':36,51 'link':40 'month':28 'nation':7,16,55,83 'national-id':82 'oauth2':9,19 'peer':75 'plugin':4,12 'privat':35 'proper':47 'provid':31 'redirect':48 'releas':26 'requir':46,68 'setup':50 'stabl':22 'system':57 'typescript':85 'url':49 'version':23 'via':41","created_at":"2026-06-04T18:50:41.032298+00:00","updated_at":"2026-06-04T18:50:41.032298+00:00","problems":[{"fix":"Change to: import { fayda } from 'fayda'","cause":"Used default import instead of named import.","error":"TypeError: fayda is not a function"},{"fix":"Set redirectURL to `<baseUrl>/api/auth/oauth2/callback/fayda` exactly.","cause":"The redirectURL configured in Fayda does not match the exact expected path.","error":"Error: Invalid OAuth callback URL"},{"fix":"Add account: { accountLinking: { enabled: true, trustedProviders: ['fayda'] } } to betterAuth config.","cause":"accountLinking.enabled is not set to true or fayda is not in trustedProviders.","error":"Error: Account linking disabled for provider 'fayda'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"fayda","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}