Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@nrk/innlogging-client

Package Overview
Dependencies
Maintainers
200
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrk/innlogging-client

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
703
-25.29%
Maintainers
200
Weekly downloads
 
Created
Source

innlogging-client

A JavaScript library for handling user authentication, consent checks, and single sign-on (SSO) on the web for NRK services.

Installation

npm install @nrk/innlogging-client

Usage

import {
  createLoginUrl,
  createLogoutUrl,
  createProfileUrl,
  createRequirementsFixUrl,
  getAccessToken,
  session,
  userMeetsRequirements,
} from '@nrk/innlogging-client/web';

// Log in a user
window.location.href = createLoginUrl();

// Navigate to profile page
window.location.href = createProfileUrl();

// Log out a user
window.location.href = createLogoutUrl();

// Check requirements and fix missing consents
const requirements = ['forum'];
const { status } = await userMeetsRequirements(requirements);
if (status === 'loggedOut') {
  window.location.href = createLoginUrl({ requirements });
} else if (status === 'missingConsent') {
  window.location.href = createRequirementsFixUrl({ requirements });
}

// Get valid access token
try {
  // Token is valid for at least 5 minutes
  const token = await getAccessToken(5);
  console.log(token);
} catch {
  // User is logged out or token could not be fetched
}

// Subscribe to session updates (e.g., name changes)
session.subscribe((s) => console.log(s));

FAQs

Package last updated on 29 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts