Skip to content

Releases: wpengine/faustjs

@faustjs/[email protected]

26 Oct 15:48
6b8676f
Compare
Choose a tag to compare

Minor Changes

  • 8630834: BREAKING: Rename HeadlessProvider to FaustProvider

@faustjs/[email protected]

21 Oct 16:16
44786df
Compare
Choose a tag to compare

Patch Changes

@faustjs/[email protected]

21 Oct 16:16
44786df
Compare
Choose a tag to compare

Patch Changes

@faustjs/[email protected]

21 Oct 16:16
44786df
Compare
Choose a tag to compare

Patch Changes

  • 81d6162: Refactored core exports and naming to make root namespace cleaner

@faustjs/[email protected]

07 Oct 18:46
c39caca
Compare
Choose a tag to compare

Patch Changes

@faustjs/[email protected]

07 Oct 18:46
c39caca
Compare
Choose a tag to compare

Patch Changes

  • 068f3c3: Fixed an issue that caused the API Router to not route requests with an authorization code

@faustjs/[email protected]

06 Oct 22:20
98c45b0
Compare
Choose a tag to compare

Patch Changes

  • 1e32f81: Typeings for getNextStaticProps and getNextServerSideProps now allow and protect custom props.

@faustjs/[email protected]

06 Oct 18:41
78a5b3a
Compare
Choose a tag to compare

Patch Changes

  • 7d30277: logQueries is can now be called and will log GraphQL queries if desired.

@faustjs/[email protected]

05 Oct 19:58
980253a
Compare
Choose a tag to compare

Minor Changes

  • 8243e9f: headlessConfig from @faustjs/core is now just config, and @faustjs/next has its own config with a global revalidate option.

    Your faust.config.js needs to change to look like this:

    import { config as coreConfig } from '@faustjs/core';
    
    if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
      console.error(
        'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?',
      );
    }
    
    /**
     * @type {import("@faustjs/core").Config}
     */
    export default coreConfig({
      wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
      apiClientSecret: process.env.WP_HEADLESS_SECRET,
    });

    Or, to configure the global revalidate option in @faustjs/next:

    import { config as coreConfig } from '@faustjs/core';
    import { config as nextConfig } from '@faustjs/next';
    
    if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
      console.error(
        'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?',
      );
    }
    
    nextConfig({
      revalidate: 60, // 1 minute
    });
    
    /**
     * @type {import("@faustjs/core").Config}
     */
    export default coreConfig({
      wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
      apiClientSecret: process.env.WP_HEADLESS_SECRET,
    });

    NOTE: @faustjs/next defaults to revalidate: 900 (15 minutes).

Patch Changes

@faustjs/[email protected]

05 Oct 19:58
980253a
Compare
Choose a tag to compare

Minor Changes

  • 8243e9f: headlessConfig from @faustjs/core is now just config, and @faustjs/next has its own config with a global revalidate option.

    Your faust.config.js needs to change to look like this:

    import { config as coreConfig } from '@faustjs/core';
    
    if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
      console.error(
        'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?',
      );
    }
    
    /**
     * @type {import("@faustjs/core").Config}
     */
    export default coreConfig({
      wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
      apiClientSecret: process.env.WP_HEADLESS_SECRET,
    });

    Or, to configure the global revalidate option in @faustjs/next:

    import { config as coreConfig } from '@faustjs/core';
    import { config as nextConfig } from '@faustjs/next';
    
    if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
      console.error(
        'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?',
      );
    }
    
    nextConfig({
      revalidate: 60, // 1 minute
    });
    
    /**
     * @type {import("@faustjs/core").Config}
     */
    export default coreConfig({
      wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
      apiClientSecret: process.env.WP_HEADLESS_SECRET,
    });

    NOTE: @faustjs/next defaults to revalidate: 900 (15 minutes).

  • 5c7f662: Introduced an argument to the useAuth hook, UseAuthOptions, to provide users the ability to disable automatic redirect from the useAuth hook upon an unauthenticated user.

    import { client } from 'client';
    
    export default function Page() {
      const { isLoading, isAuthenticated, authResult } = client.auth.useAuth({
        shouldRedirect: false,
      });
    
      if (isLoading) {
        return <p>Loading...</p>;
      }
    
      if (!isAuthenticated) {
        return (
          <p>You need to be authenticated to see this content. Please login.</p>
        );
      }
    
      return <p>Authenticated content</p>;
    }

Patch Changes