npm altcha-lib 2.7.0
v2.7.0

5 hours ago

This release adds support for SvelteKit 3 (#21). The SvelteKit plugin works with both SvelteKit 2 and 3, and npm no longer fails with ERESOLVE when altcha-lib is installed in a SvelteKit 3 project.

Compatibility: no changes to challenges, payloads or the public API. The SvelteKit plugin (altcha-lib/frameworks/sveltekit) is now ESM-only; see Upgrade notes. Every other entry point still ships both ESM and CommonJS builds.

Fixes

  • SvelteKit 3 peer dependency. The optional @sveltejs/kit peer dependency now accepts ^2.0.0 || ^3.0.0. Before, npm refused to install altcha-lib next to @sveltejs/kit@3.
  • SvelteKit 3 types. SvelteKit 3 moved the Handle type from @sveltejs/kit to @sveltejs/kit/hooks. The plugin no longer imports Handle from @sveltejs/kit, so it type-checks against both versions. createHandle() still returns SvelteKit's own Handle type and can be passed to sequence() as before.

Changes

  • The SvelteKit plugin is ESM-only. @sveltejs/kit offers only an import entry point, so it can't be loaded with require(). The CommonJS build of the plugin therefore failed on load with ERR_PACKAGE_PATH_NOT_EXPORTED, and it has been removed. SvelteKit apps are ESM, so they are not affected.
  • Response.json. challengeHandler and verifyHandler build their responses with the standard Response.json instead of SvelteKit's json helper, which SvelteKit 3 deprecates. Status codes, Content-Type, Cache-Control and response bodies are unchanged; SvelteKit's helper also set Content-Length explicitly.

Upgrade notes

Most deployments need no changes.

  • SvelteKit 3. Upgrade altcha-lib, then remove any --legacy-peer-deps or overrides you added to work around the install error.
  • Handle in your own hooks. On SvelteKit 3, import Handle from @sveltejs/kit/hooks. On SvelteKit 2, it stays in @sveltejs/kit. The hooks example in docs/sveltekit.md shows the SvelteKit 3 form.
  • CommonJS. require('altcha-lib/frameworks/sveltekit') now fails while the package is being resolved, with an error that names altcha-lib. Use import instead; import() also works from CommonJS files.

Full changelog: v2.6.0...v2.7.0

Don't miss a new altcha-lib release

NewReleases is sending notifications on new releases.