1. Quick starts

Quick start (CLI)

Version: 0.4

This guide describes how to start developing for the Sitecore Marketplace locally by scaffolding a Next.js App Router app with the Marketplace SDK using a single command. This guide is for building client-side and full-stack apps, with either the built-in authorization or custom authorization.

In this guide, you:

  1. Scaffold an app.

  2. Open your app in Sitecore.

Prerequisites

Check that you have the following, before getting started:

  • A Marketplace app installed in your Sitecore Cloud Portal organization.

  • If you decide to use custom authorization, make sure your app has client credentials, and set up a custom DNS for local development.

    Note

    The quick start templates use @auth0/auth0-react for client-side authentication, which provides better support for organizations with multiple environments. When creating client credentials, make sure to select Single-page app (SPA) as the application type, even if you're building a full-stack Next.js app.

    However, the Marketplace SDK does not impose constraints on which Auth0 library you use. If you prefer to use @auth0/nextjs-auth0 with server-side authentication patterns, you can replace the package and adapt the implementation accordingly.

    For more information, refer to the Auth0 documentation.

  • Node.js 16 or later. Check your installed version by using the node --version command.

  • npm 10 or later. Check your installed version by using the npm --version command.

Scaffold an app

To start development, you scaffold a Next.js App Router app using a single command. This process creates a Next.js App Router project and installs the necessary Marketplace SDK packages, Blok, and additional packages depending on your app requirements.

To scaffold an app:

Open your app in Sitecore

After scaffolding your app, you open your Marketplace app in a Sitecore extension point you selected for it during app configuration.

To open your app in Sitecore:

Next steps

You've now displayed your app in Sitecore, read the application context, and made a call to SitecoreAI APIs. Next, you can:

  • Explore the project structure:

    • app/page.tsx is your app's entry point.

    • app/api contains calls to SitecoreAI APIs.

    • components/providers contains the SDK initialization and authorization code.

    • components/ui contains Blok-style components, such as cards, buttons, and badges.

  • Continue developing your app:

  • Learn more about the Marketplace SDK with the reference documentation.

  • Explore other tasks to complete after you finish building your app.

If you have suggestions for improving this article, let us know!