Quick start (CLI)
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-sideclient-side and full-stackfull-stack apps, with either the built-in authorizationbuilt-in authorization or custom authorizationcustom authorization.
In this guide, you:
-
Scaffold an app.
-
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.
NoteThe quick start templates use
@auth0/auth0-reactfor 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-auth0with 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 --versioncommand. -
npm 10 or later. Check your installed version by using the
npm --versioncommand.
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.tsxis your app's entry point. -
app/apicontains calls to SitecoreAI APIs. -
components/providerscontains the SDK initialization and authorization code. -
components/uicontains Blok-style components, such as cards, buttons, and badges.
-
-
Continue developing your app:
-
Make more queries to retrieve data from Sitecore.
-
Make mutations to change data in Sitecore.
-
-
Learn more about the Marketplace SDK with the reference documentation.
-
Explore other tasks to complete after you finish building your app.