npm.io
6.0.0 • Published 3 weeks ago

@schibsted/account-sdk-browser

Licence
MIT
Version
6.0.0
Deps
0
Size
414 kB
Vulns
0
Weekly
0

Schibsted Account SDK for browsers

Welcome! This is the home of the Schibsted Account JavaScript SDK for browsers. Use it to let users sign up and log in with Schibsted Account, read the current session, and check access to products and features.

See the public SDK documentation for setup, integration guidance, and the API reference.

Before You Start

The SDK communicates mainly with Session Service on a brand domain such as id.vg.no. Your website and Session Service domain must share the same top-level site so browser cookies are sent with XHR requests.

For local development:

  • serve your site over HTTPS, because Session Service is hosted over HTTPS
  • use a local hostname with the same top-level site as the configured Session Service domain

For example, if your pre-production site is pre.sdk-example.com and uses id.pre.sdk-example.com as Session Service, use a local hostname such as local.sdk-example.com.

If this is a new site and you do not have a sessionDomain yet, contact support.

Development

Dependencies are installed from Schibsted Artifactory (see .npmrc), so npm must be authenticated to it before npm install. The private @schibsted/consent-url-utils package is bundled into dist/ by Vite during npm run build, so SDK consumers do not need access to it.

Install dependencies and run the standard checks:

npm ci
npm run build
npm test
npm run lint
npm run typecheck

API Documentation

Public API documentation is generated from TypeScript source comments with TypeDoc.

Documentation commands:

  • npm run docs:build generates the documentation once in docs/.
  • npm run docs:watch rebuilds docs/ when source files change, without starting a server.
  • npm run docs:preview builds and serves the documentation locally in the versioned layout.
  • npm run docs:test tests documentation versioning and publishing.

Generated docs are written to docs/ and are not committed.

After npm publishing succeeds, the documentation workflow builds docs from the release tag and adds them to the public schibsted/account-sdk-browser repository. Existing versions remain available, and the documentation root and version selector point to the latest stable published version.

To publish an existing release again, run the documentation workflow manually with its tag. Publishing requires the public-docs environment with a PUBLIC_GITHUB_DOCS_DEPLOY_KEY secret containing the private key for a write-enabled deploy key configured in the public repository.

Example Project

The internal example integration is available in the sdk-example repository.

Publishing

Versioning and changelog updates are handled by Release Please. The release configuration lives in release-please-config.json, and publishing to npmjs.org is handled by the npm-publish workflow when a GitHub Release is published.

Use Conventional Commits for changes that should be picked up by release automation.

License

Copyright (c) 2026 Schibsted Products & Technology AS

Licensed under the MIT License.