Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Official Plugin
View plugin on GitHub

gatsby-plugin-create-client-paths

Please Note: With recent versions of Gatsby this plugin became obsolete. See migration notes below, or refer to the File System Route API documentation for details on how client only routes are now handled.

Use this plugin to simplify creating a “hybrid” Gatsby app with both statically rendered pages as well as “client-paths”. These paths exist on the client only and do not correspond to index.html files in an app’s built assets.

For more information refer to client-only routes & user authentication.

Migration

Extending from the use case below where the gatsby-plugin-create-client-paths plugin has a prefix of /app/*, the way you would do this with the File System Route API is by adopting this structure in your project:

|-- /src
  |-- /pages
    |-- /app
      |-- [...].js

Additionally, you can also refer to the client-only-paths example.

Usage

Install:

npm install gatsby-plugin-create-client-paths

Then configure via gatsby-config.js:

    {
      resolve: `gatsby-plugin-create-client-paths`,
      options: { prefixes: [`/app/*`] },
    },

In this example, all paths prefixed by /app/ will render the route described in src/pages/app.js.

© 2023 Gatsby, Inc.