Verify student emails and get school names using swot domain data. Supports multi-campus schools and aliases.
npm install jbs-swot-emailimport { verify, school_name, school_name_primary } from "jbs-swot-email";
// Verify email (async) - returns detailed status
const result = await verify("student@mit.edu");
// Returns: { valid: true, status: "valid" }
// Check for stoplist or abused domains
const stoplistResult = await verify("student@alumni.stanford.edu");
// Returns: { valid: false, status: "stoplist" }
const abusedResult = await verify("student@gmail.com");
// Returns: { valid: false, status: "abused" }
const invalidResult = await verify("student@notaschool.com");
// Returns: { valid: false, status: "invalid" }
// Get all school names (async) - supports multi-campus and aliases
const schoolNames = await school_name("student@utoronto.ca");
// Returns: [
// "University of St. Michael's College",
// "University of Toronto",
// "University of Toronto, Mississauga",
// "University of Toronto, Scarborough",
// "University of Trinity College",
// "Victoria University Toronto, University of Toronto"
// ]
// Get primary school name (async)
const primaryName = await school_name_primary("student@utoronto.ca");
// Returns: "University of St. Michael's College"
// Single school example
const mitNames = await school_name("student@mit.edu");
// Returns: ["Massachusetts Institute of Technology"]Verify if email belongs to an educational institution and get detailed status.
Returns:
interface VerifyResult {
valid: boolean;
status: "valid" | "stoplist" | "abused" | "invalid";
}valid: true, status: "valid"- Valid educational emailvalid: false, status: "stoplist"- Domain is in stoplist (e.g., alumni emails)valid: false, status: "abused"- Domain has been abused for fake signupsvalid: false, status: "invalid"- Not an educational domain
Get all school names for the email domain. Supports multi-campus schools and aliases.
Returns: Array of school names or null if domain is stoplist/abused/invalid
Get the primary (first) school name for the email domain.
Returns: Primary school name or null if domain is stoplist/abused/invalid
- ✅ Support for multi-campus schools (e.g., University of Toronto's various campuses)
- ✅ Support for school aliases (e.g., ETH Zürich and Swiss Federal Institute of Technology)
- ✅ Detects stoplist domains (alumni emails, etc.)
- ✅ Detects abused domains (known fake signup domains)
- ✅ Detailed verification status for better error handling
- ✅ Based on authoritative swot domain database
- ✅ Supports 25,000+ educational institution domains
This package uses domain data from the JetBrains swot repository, which is an official JetBrains project used to verify educational email addresses for granting free licenses to students and teachers worldwide.
The swot repository contains a hierarchically structured list of email domains belonging to educational institutions, including colleges, universities, and groups of schools.
npm run sync:swot- Sync JetBrains swot repositorynpm run generate- Generate tree data structurenpm run build- Build production codenpm run test- Run unit testsnpm run release- 🚀 One-click release (sync, build, test, version, publish)
Use the automated release script:
npm run releaseThe release script will automatically:
- ✅ Pull latest swot data
- ✅ Generate data files
- ✅ Build production code
- ✅ Run test suite
- ✅ Update version number
- ✅ Git commit and tag
- ✅ Publish to npm
See scripts/README.md for detailed documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
The educational domain data used in this package is from the JetBrains swot repository, which is licensed under the MIT License:
The MIT License (MIT)
Copyright (c) 2013 Lee Reilly
- Thanks to JetBrains and Lee Reilly for maintaining the swot repository
- All contributors to the swot repository for keeping the educational domain data up-to-date