Ingen beskrivning
  • TypeScript 71.4%
  • JavaScript 28.6%
Hitta en fil
Kodförråd filer (senaste incheckning först)
Filnamn Senaste incheckningsmeddelande Senaste incheckningsdatum
Bitborg Renovate a46410efdf
En del kontroller misslyckades
Publish to npm / publish (push) Waiting to run
CI / commitlint (push) Failing after 55s
chore(deps): update all non-major dependencies (#15)
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | Pending |
|---|---|---|---|---|---|---|
| [@eslint/js](https://eslint.org) ([source](https://github.com/eslint/eslint/tree/HEAD/packages/js)) | [`9.33.0` → `9.39.5`](https://renovatebot.com/diffs/npm/@eslint%2fjs/9.33.0/9.39.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@eslint%2fjs/9.39.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@eslint%2fjs/9.33.0/9.39.5?slim=true) | devDependencies | minor |  |
| [@next/eslint-plugin-next](https://github.com/vercel/next.js) ([source](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-plugin-next)) | [`15.5.0` → `15.5.26`](https://renovatebot.com/diffs/npm/@next%2feslint-plugin-next/15.5.0/15.5.26) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@next%2feslint-plugin-next/15.5.26?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@next%2feslint-plugin-next/15.5.0/15.5.26?slim=true) | devDependencies | patch | `15.5.27` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | [`24.3.0` → `24.19.0`](https://renovatebot.com/diffs/npm/@types%2fnode/24.3.0/24.19.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/24.19.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/24.3.0/24.19.0?slim=true) | devDependencies | minor | `24.19.1` |
| [@vitest/coverage-v8](https://vitest.dev/guide/coverage) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | [`3.2.4` → `3.2.7`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/3.2.4/3.2.7) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fcoverage-v8/3.2.7?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fcoverage-v8/3.2.4/3.2.7?slim=true) | devDependencies | patch |  |
| [@vitest/ui](https://vitest.dev/guide/ui) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/ui)) | [`3.2.4` → `3.2.7`](https://renovatebot.com/diffs/npm/@vitest%2fui/3.2.4/3.2.7) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@vitest%2fui/3.2.7?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@vitest%2fui/3.2.4/3.2.7?slim=true) | devDependencies | patch |  |
| [conventional-changelog](https://conventional-changelog.js.org/conventional-changelog/) ([source](https://github.com/conventional-changelog/conventional-changelog/tree/HEAD/packages/conventional-changelog)) | [`7.1.1` → `7.2.1`](https://renovatebot.com/diffs/npm/conventional-changelog/7.1.1/7.2.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/conventional-changelog/7.2.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/conventional-changelog/7.1.1/7.2.1?slim=true) | devDependencies | minor |  |
| [conventional-changelog-conventionalcommits](https://conventional-changelog.js.org/presets/conventional-commits/) ([source](https://github.com/conventional-changelog/conventional-changelog/tree/HEAD/packages/conventional-changelog-conventionalcommits)) | [`9.1.0` → `9.3.1`](https://renovatebot.com/diffs/npm/conventional-changelog-conventionalcommits/9.1.0/9.3.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/conventional-changelog-conventionalcommits/9.3.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/conventional-changelog-conventionalcommits/9.1.0/9.3.1?slim=true) | devDependencies | minor |  |
| [czg](https://cz-git.qbb.sh/cli/) ([source](https://github.com/Zhengqbbb/cz-git/tree/HEAD/packages/cli)) | [`1.12.0` → `1.14.0`](https://renovatebot.com/diffs/npm/czg/1.12.0/1.14.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/czg/1.14.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/czg/1.12.0/1.14.0?slim=true) | devDependencies | minor |  |
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | [`9.33.0` → `9.39.5`](https://renovatebot.com/diffs/npm/eslint/9.33.0/9.39.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/eslint/9.39.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint/9.33.0/9.39.5?slim=true) | devDependencies | minor |  |
| [eslint-plugin-perfectionist](https://perfectionist.dev) ([source](https://github.com/azat-io/eslint-plugin-perfectionist)) | [`4.15.0` → `4.15.1`](https://renovatebot.com/diffs/npm/eslint-plugin-perfectionist/4.15.0/4.15.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-perfectionist/4.15.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-perfectionist/4.15.0/4.15.1?slim=true) | devDependencies | patch |  |
| [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/analysis/src/jsts/rules/README.md) ([source](https://github.com/SonarSource/SonarJS)) | [`3.0.4` → `3.0.7`](https://renovatebot.com/diffs/npm/eslint-plugin-sonarjs/3.0.4/3.0.7) | ![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-sonarjs/3.0.7?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-sonarjs/3.0.4/3.0.7?slim=true) | devDependencies | patch |  |
| [eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports) | [`4.2.0` → `4.4.1`](https://renovatebot.com/diffs/npm/eslint-plugin-unused-imports/4.2.0/4.4.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-unused-imports/4.4.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-unused-imports/4.2.0/4.4.1?slim=true) | devDependencies | minor |  |
| [globals](https://github.com/sindresorhus/globals) | [`16.3.0` → `16.5.0`](https://renovatebot.com/diffs/npm/globals/16.3.0/16.5.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/globals/16.5.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/globals/16.3.0/16.5.0?slim=true) | devDependencies | minor |  |
| [lefthook](https://github.com/evilmartians/lefthook) | [`1.12.3` → `1.13.6`](https://renovatebot.com/diffs/npm/lefthook/1.12.3/1.13.6) | ![age](https://developer.mend.io/api/mc/badges/age/npm/lefthook/1.13.6?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/lefthook/1.12.3/1.13.6?slim=true) | devDependencies | minor |  |
| [next](https://nextjs.org) ([source](https://github.com/vercel/next.js)) | [`15.5.0` → `15.5.26`](https://renovatebot.com/diffs/npm/next/15.5.0/15.5.26) | ![age](https://developer.mend.io/api/mc/badges/age/npm/next/15.5.26?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/next/15.5.0/15.5.26?slim=true) | devDependencies | patch | `15.5.27` |
| [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | [`22.18.0` → `22.23.3`](https://renovatebot.com/diffs/npm/node/v22.18.0/v22.23.3) | ![age](https://developer.mend.io/api/mc/badges/age/node-version/node/v22.23.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/node-version/node/v22.18.0/v22.23.3?slim=true) | volta | minor |  |
| [prettier](https://prettier.io) ([source](https://github.com/prettier/prettier)) | [`3.6.2` → `3.9.9`](https://renovatebot.com/diffs/npm/prettier/3.6.2/3.9.9) | ![age](https://developer.mend.io/api/mc/badges/age/npm/prettier/3.9.9?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/prettier/3.6.2/3.9.9?slim=true) | devDependencies | minor |  |
| [react](https://react.dev/) ([source](https://github.com/react/react/tree/HEAD/packages/react)) | [`19.1.1` → `19.3.0`](https://renovatebot.com/diffs/npm/react/19.1.1/19.3.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/react/19.3.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react/19.1.1/19.3.0?slim=true) | devDependencies | minor |  |
| [react-dom](https://react.dev/) ([source](https://github.com/react/react/tree/HEAD/packages/react-dom)) | [`19.1.1` → `19.3.0`](https://renovatebot.com/diffs/npm/react-dom/19.1.1/19.3.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/react-dom/19.3.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-dom/19.1.1/19.3.0?slim=true) | devDependencies | minor |  |
| [tsup](https://tsup.egoist.dev/) ([source](https://github.com/egoist/tsup)) | [`8.5.0` → `8.5.1`](https://renovatebot.com/diffs/npm/tsup/8.5.0/8.5.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/tsup/8.5.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tsup/8.5.0/8.5.1?slim=true) | devDependencies | patch |  |
| [typescript-eslint](https://typescript-eslint.io/packages/typescript-eslint) ([source](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint)) | [`8.40.0` → `8.71.0`](https://renovatebot.com/diffs/npm/typescript-eslint/8.40.0/8.71.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/typescript-eslint/8.71.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/typescript-eslint/8.40.0/8.71.0?slim=true) | devDependencies | minor |  |

> ❗ **Important**
>
> Release Notes retrieval for this PR were skipped because no github.com credentials were available.
> If you are self-hosted, please see [this instruction](https://github.com/renovatebot/renovate/blob/master/docs/usage/examples/self-hosting.md#githubcom-token-for-release-notes).

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: Johannes <445378+supernaut@users.noreply.github.com>
Reviewed-on: #15
2026-10-02 21:00:09 +00:00
.agents/skills/add-public-utility chore: agentic-setup (#13) 2026-10-02 14:27:45 +00:00
.claude chore: agentic-setup (#13) 2026-10-02 14:27:45 +00:00
.cspell chore: Release v1.1.0 2025-08-22 09:41:16 +02:00
.github/workflows chore(deps): update all non-major dependencies (#15) 2026-10-02 21:00:09 +00:00
.vscode chore(deps): update all non-major dependencies (#15) 2026-10-02 21:00:09 +00:00
src test: improve tests 2025-08-21 23:22:01 +02:00
.gitignore chore: agentic-setup (#13) 2026-10-02 14:27:45 +00:00
.npmignore fix: add build step to publish pipeline 2025-08-22 09:23:03 +02:00
.prettierignore feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
.prettierrc feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
AGENTS.md chore: agentic-setup (#13) 2026-10-02 14:27:45 +00:00
CHANGELOG.md chore: release v.1.1.1 2025-08-22 09:48:46 +02:00
CLAUDE.md chore: agentic-setup (#13) 2026-10-02 14:27:45 +00:00
commitlint.config.js feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
eslint.config.mjs feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
lefthook.json feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
LICENSE feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
package.json chore(deps): update all non-major dependencies (#15) 2026-10-02 21:00:09 +00:00
pnpm-lock.yaml chore(deps): update all non-major dependencies (#15) 2026-10-02 21:00:09 +00:00
pnpm-workspace.yaml chore(deps): update dependency vitest to v3.2.7 (#9) 2026-10-02 14:44:29 +00:00
readme.md docs: add clarifiyng link to nextjs 2025-08-22 09:46:42 +02:00
release.md fix: add build step to publish pipeline 2025-08-22 09:23:03 +02:00
renovate.json chore: group Renovate updates and delay new releases (#12) 2026-10-02 14:23:35 +00:00
tsconfig.json feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
tsup.config.ts feat: add method to check if request is from storyblok 2025-08-21 22:52:06 +02:00
vitest.config.ts test: improve tests 2025-08-21 23:22:01 +02:00

Storyblok Tools

Tools to simplify recurring tasks when working with Storyblok in Next.js.

Usage

Install the package using your package manager of choice:

pnpm add @supernaut/storyblok-tools
npm install @supernaut/storyblok-tools
yarn add @supernaut/storyblok-tools

Check If Request Comes from Storyblok

This function checks whether an incoming request URL originates from Storyblok's visual editor ("in-editor" / preview mode) by validating the signed query parameters Storyblok appends to iframe / bridge requests.

Validation steps performed:

  1. Ensures a request URL and a Storyblok preview token are present. The preview token is taken from the optional storyblokToken argument or the STORYBLOK_PREVIEW_TOKEN environment variable.
  2. Verifies the URL contains the required query parameters:
    • _storyblok_tk[token] (HMAC-like validation hash Storyblok generates)
    • _storyblok_tk[space_id] (numeric space identifier)
    • _storyblok_tk[timestamp] (unix timestamp in seconds)
  3. Recomputes the expected validation token using SHA-1 over the string ${space_id}:${previewToken}:${timestamp}
  4. Compares the recomputed token with the provided one AND checks that the timestamp is not older than 1 hour (3600 seconds).

Any thrown error or failed validation path results in false.

This is heavily inspired by the work of Jorge Martins in this gist

import { isStoryblokRequest } from "@supernaut/storyblok-tools";

function requestHandler(request: Request) {
  const isFromStoryblok = await isStoryblokRequest(request.url);
  if (!isFromStoryblok) {
    throw new Error("Request was not from Storyblok preview!");
  }
}

Example Next.js Route Handler for Storyblok Preview

Given that you put the handler in app/api/draft/route.ts and your public website is https://www.example.com/ you can then provide this as the preview URL for the storyblok visual editor: https://www.example.com/api/draft?slug=

This route handler only works with the Next.js app router.

import { isStoryblokRequest } from "@supernaut/storyblok-tools";

return async function GET(request: Request) {
  const isFromStoryblok = await isStoryblokRequest(request.url);
  const requestUrl = new URL(request.url);
  const { searchParams } = requestUrl;
  const slug = searchParams.get("slug");

  if (!isFromStoryblok || !slug) {
    redirect("/api/end-draft");
  }

  if (isFromStoryblok) {
    // Set URL
    const url = new URL(requestUrl);
    url.pathname = `/${slug}`;

    // Enable draft mode
    const draftObject = await draftMode();
    draftObject.enable();

    // Modify draft cookie for Storyblok
    const cookiesObject = await cookies();
    const draftCookie = { ...cookiesObject.get("__prerender_bypass") };
    if (draftCookie) {
      cookiesObject.set({
        httpOnly: true,
        name: "__prerender_bypass",
        path: "/",
        sameSite: "none",
        secure: true,
        value: draftCookie.value ?? "",
      });
    }

    // Redirect to correct location
    return NextResponse.redirect(url, 307);
  }
};

Exmaple Next.js Route Handler for Ending Preview

This route handler only works with the Next.js app router.

return async function GET(request: Request) {
  // Disable draft mode
  const draftModeObject = await draftMode();
  draftModeObject.disable();

  // Modify draft cookie for Storyblok
  const cookiesObject = await cookies();
  const draftCookie = { ...cookiesObject.get("__prerender_bypass") };
  if (draftCookie) {
    cookiesObject.set({
      expires: new Date(0), // Set expiration date to the past
      httpOnly: true,
      name: "__prerender_bypass",
      path: "/",
      sameSite: "none",
      secure: true,
      value: draftCookie.value ?? "",
    });
  }

  // Redirect to index
  redirect("/");
};