better-auth-university
v0.8.0
Published
A university plugin for Better Auth that allows restriction of email domains.
Maintainers
Readme
Better Auth University Plugin
A university plugin for Better Auth that allows restriction of email domains.
Installation
npm install better-auth-universitySetup
To use the Better Auth University Plugin, you need to configure it with a list of universities and their associated email domains. You can also specify allowed email domains for user registration.
If you would like a comprehensive list of universities, consider going to the university-domains-list for options of obtaining the data. There is a world_universities_and_domains.json which can be easily passed to the university parameter.
import { universityResolver } from "better-auth-university";
const plugin = universityResolver({
universities: [
{
name: "Massachusetts Institute of Technology",
domains: ["mit.edu"],
web_pages: ["http://web.mit.edu/"],
country: "United States",
alpha_two_code: "US",
"state-province": "Massachusetts",
},
],
allowedEmailDomains: [".edu", ".ac.uk"],
});