npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

standard-education-client

v0.0.15

Published

Standard Education HTTP client - Private API client for education management

Readme

Standard Education Client

A TypeScript/JavaScript client library for the Standard Education API.

Installation

From GitHub Packages (Private)

npm install @smtanbin/standard-education-client

Or with yarn:

yarn add @smtanbin/standard-education-client

Usage

Basic Setup

import Api from '@tanbibn/standard-education-client';

// Initialize the API client with your base URL
const api = new Api('https://your-domain.com');

// Or with custom API prefix and version
const api = new Api('https://your-domain.com', '/api/v', '1');

Authentication

// Login with username and password
const loginResponse = await api.auth.login('username', 'password');
console.log('Logged in:', loginResponse);

// The client automatically stores and manages access/refresh tokens
// All subsequent API calls will include the Bearer token automatically

// Logout
await api.auth.logout();

Users

// Get current user
const currentUser = await api.users.getCurrentUser();
console.log('Current user:', currentUser.data);

// Get user by ID
const user = await api.users.getUserByID('user-id-123');
console.log('User:', user.data);

// Add a new user
const newUser = await api.users.addUser({
  username: 'johndoe',
  email: '[email protected]',
  first_name: 'John',
  last_name: 'Doe',
  phone: '+1234567890',
  instituted_id: 'inst-123'
});

// Update user
const updated = await api.users.updateUser('user-id-123', {
  email: '[email protected]',
  phone: '+9876543210'
});

Institutions

// Get all institutions
const institutions = await api.institutions.GetAllInstitutions();
console.log('Institutions:', institutions.data);

// Get dashboard data for an institution
const dashboard = await api.institutions.GetDashboardData('inst-123');
console.log('Dashboard:', dashboard.data);

// Get institution by ID
const institution = await api.institutions.GetInstitutionByID('inst-123');

// Add new institution
const newInst = await api.institutions.AddInstitution(
  'customer-123',
  'School Name',
  'John Doe',
  'New York, NY',
  '+1234567890',
  '[email protected]',
  'https://school.com',
  '2020-01-01',
  'ACC123',
  'token123',
  'logo-url',
  '2024-01-01',
  'Notes here',
  'file-123'
);

// Close institution
await api.institutions.CloseInstitution('inst-123');

Features

  • Automatic Token Management: Access and refresh tokens are automatically stored and managed
  • Auto Token Refresh: On 401 errors, the client automatically attempts to refresh the access token
  • TypeScript Support: Full TypeScript definitions included
  • Browser & Node.js: Works in both environments with smart storage (cookieStore > localStorage > memory)
  • Multiple Build Formats: CommonJS, ESM, and UMD builds available

API Structure

The API client follows the backend route structure:

  • Base URL: {domain}/api/v1/
  • Authentication endpoints: /auth/*
  • User endpoints: /users/*
  • Institution endpoints: /institutions/*

Authentication Flow

  1. Login: Call api.auth.login(username, password) - uses Basic auth
  2. Auto Bearer Token: All subsequent requests automatically include Bearer {access_token} header
  3. Auto Refresh: On 401 response, the client automatically calls /auth/refresh/:userid with the refresh token
  4. Logout: Call api.auth.logout() to clear tokens and notify the backend

Error Handling

try {
  const user = await api.users.getCurrentUser();
  console.log(user.data);
} catch (error) {
  if (error.response?.status === 401) {
    console.error('Authentication failed');
  } else {
    console.error('Error:', error.message);
  }
}

Development

# Install dependencies
npm install

# Build the library
npm run build

# Run tests
npm test

# Watch mode for development
npm run dev

License

UNLICENSED - Private use only