JSPM

daystar-verify

1.0.4
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 16
    • Score
      100M100P100Q50873F
    • License ISC

    A library for verifying student status with Daystar University.

    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-verify

    Environment Variable

    Set the Daystar portal URL in your environment:

    DAYSTAR_PORTAL_URL=https://your-portal-url.com

    Usage

    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 unreachable
    • Failed to retrieve session token — unexpected response from portal
    • Unauthorised 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