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

@certible/seb-node

v2.0.1

Published

TypeScript library for creating Safe Exam Browser (SEB) configuration files and handling Config Keys (server-side and browser)

Readme

@certible/seb-node

A TypeScript library for creating Safe Exam Browser (SEB) configuration files and working with SEB Config Keys.

Installation

npm install @certible/seb-node

Usage

Server-side (Node.js)

Import from the main package for server-side operations:

import { writeFileSync } from 'node:fs';
import { generateSEBConfig } from '@certible/seb-node';

// Create a basic SEB configuration
const result = await generateSEBConfig({
  startURL: 'https://exam.example.com',
  allowQuit: false,
  browserViewMode: 1, // Fullscreen
  URLFilterEnable: true,
  URLFilterRules: [
    {
      active: true,
      expression: 'example.com',
      action: 1, // Allow
    },
  ],
});

// Save to file
writeFileSync('exam.seb', result.data);
console.log(`Created SEB file (${result.size} bytes)`);

Encrypted Configuration

Create a password-protected SEB file:

const result = await generateSEBConfig(
  {
    startURL: 'https://exam.example.com',
    allowQuit: false,
  },
  {
    encrypt: true,
    password: 'your-secure-password',
  }
);

Without Validation

Skip schema validation for custom configurations:

const result = await generateSEBConfig(
  {
    startURL: 'https://exam.example.com',
    customField: 'custom-value', // Not in schema
  },
  {
    validate: false,
  }
);

Config Key Generation and Verification

The Config Key feature allows exam systems to verify that SEB clients are using the correct configuration.

Server-side: Generate Config Key

import { generateConfigKey } from '@certible/seb-node';

const config = {
  startURL: 'https://exam.example.com',
  allowQuit: false,
  browserViewMode: 1,
  sendBrowserExamKey: true,
};

// Generate the Config Key (64-char hex string)
const configKey = generateConfigKey(config);
console.log('Config Key:', configKey);
// e.g., "81aad4ab9dfd447cc479e6a4a7c9a544e2cafc7f3adeb68b2a21efad68eca4dc"

Server-side: Verify Config Key from HTTP Headers

When SEB sends requests, it includes the Config Key hash in the X-SafeExamBrowser-ConfigKeyHash header:

import { verifyConfigKeyHash } from '@certible/seb-node';

app.get('/exam', (req, res) => {
  const configKey = '81aad4ab9dfd447cc479e6a4a7c9a544e2cafc7f3adeb68b2a21efad68eca4dc';
  const requestURL = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
  const receivedHash = req.headers['x-safeexambrowser-configkeyhash'];

  const isValid = verifyConfigKeyHash(requestURL, configKey, receivedHash);
});

Client-side: Access SEB Keys via JavaScript API

In your web application running inside SEB, import from the /web export:

import { getSEBKeys, isSEBAvailable } from '@certible/seb-node/web';

const keys = getSEBKeys();

if (keys.isAvailable) {
  console.log('Config Key:', keys.configKey);
  console.log('Browser Exam Key:', keys.browserExamKey);
  console.log('SEB Version:', keys.version);
}

Note: The Config Key and Browser Exam Key obtained via getSEBKeys are hashed with the current URL. In single-page applications (SPAs), SEB will not update the hash, so ensure that the URL for the hash reflects the correct state when verifying keys.

Import Paths

// Server-side: Main package
import { generateConfigKey, generateSEBConfig, verifyConfigKeyHash } from '@certible/seb-node';

// Client-side: Web export (smaller bundle, browser-only code)
import { getSEBKeys, isSEBAvailable } from '@certible/seb-node/web';

Resources

License

MPL-2 License - see the LICENSE file for details.

Related Projects

About

This package is developed and maintained by Certible.