Package Exports
- daystar-verify
- daystar-verify/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (daystar-verify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
daystar-verify
Verify that a student exists at Daystar University by authenticating against the student portal.
Installation
npm install daystar-verify
# or
pnpm add daystar-verifyEnvironment Variable
Set the Daystar portal URL in your environment:
DAYSTAR_PORTAL_URL=https://your-portal-url.comUsage
import { fetchSessionToken, login } from "daystar-verify";
async function verifyStudent(admno: string, password: string) {
const token = await fetchSessionToken();
const session = await login(token, admno, password);
return session;
}Error Handling
Both functions throw on failure, so wrap in a try/catch:
import { fetchSessionToken, login } from "daystar-verify";
async function verifyStudent(admno: string, password: string) {
try {
const token = await fetchSessionToken();
const session = await login(token, admno, password);
return session;
} catch (err) {
console.error("Verification failed:", err.message);
}
}Common errors:
Failed to communicate with server— portal is unreachableFailed to retrieve session token— unexpected response from portalUnauthorised Login. Visit Registrar's Office— invalid credentials
API
fetchSessionToken(): Promise<string>
Hits the portal root and retrieves an initial session cookie required for login.
login(sessionId, admno, password): Promise<string>
Authenticates the student and returns a session string on success.
| Parameter | Type | Description |
|---|---|---|
sessionId |
string |
Token returned by fetchSessionToken() |
admno |
string |
Student admission number |
password |
string |
Student password |
License
ISC