Packages

astro

7.4.13 · 18 Nov 2026MIT12.5M / weekRepositoryHomepagenpmAtom feed

Your version

5.4.1

28 Feb 2025Where it was published

5.18.2 is the newest release of 5.x.

In short

3 fixed

Security

23 advisories affect 5.4.1; 7.4.5 fixes them

18 more

Release note

Patch Changes

  • Fixes a regression where some asset utilities were move across monorepo, and not re-exported anymore.

  • Thanks @{! - Adds support for typing experimental session data

    You can add optional types to your session data by creating a src/env.d.ts file in your project that extends the global App.SessionData interface. For example:

    declare namespace App {
      interface SessionData {
    
          id: string;
          email: string;
        };
        lastLogin: Date;
      }
    }

    Any keys not defined in this interface will be treated as any.

    Then when you access Astro.session in your components, any defined keys will be typed correctly:

    ---
    const user = await Astro.session.get('user');
    //    ^? const: user: { id: string; email: string; } | undefined
    
    const something = await Astro.session.get('something');
    //    ^? const: something: any
    
    Astro.session.set('user', 1);
    //    ^? Argument of type 'number' is not assignable to parameter of type '{ id: string; email: string; }'.
    ---

    See the experimental session docs for more information.

  • Fixes an issue with the conditional rendering of scripts.

    This change updates a v5.0 breaking change when experimental.directRenderScript became the default script handling behavior.

    If you have already successfully upgraded to Astro v5, you may need to review your script tags again and make sure they still behave as desired after this release. See the v5 Upgrade Guide for more details.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.