Skip to main content

Get Started - Tutorial

Prerequisites

Install Oversite

To add the Perfection tools to your applications, you can install Oversite via an NPM package, load it as a script or inject it via Google Tag Manager:

>_ Terminal
npm install @perfectiondev/oversite

Get an API Key

Before you start configuring Perfection, you need to login in to the Admin Panel. By doing so, you will be able to invite users and generate an API Key.

If you don't have access to Perfection yet and need an account, get in touch with us through this contact us form.

API Keys, used to access the Perfection APIs, can be managed under the Settings section of the Perfection Admin Panel

Initialize Oversite

To store your Perfection's Site Name, API Key and Subscription ID, you can create an .env.local file that should be localted at the root folder of your project. Once you have this set, you can initialize Oversite as follow:

app/components/oversite.js
"use client";
import oversite from "@perfectiondev/oversite";

export default function Oversite() {
oversite.initialize({
apiKey: process.env.NEXT_PUBLIC_PERFECTION_API_KEY,
subscription: process.env.NEXT_PUBLIC_PERFECTION_SUBSCRIPTION_ID,
site: process.env.NEXT_PUBLIC_PERFECTION_SITE_NAME,
});
}
info

As Oversite is using browser APIs, you need to use ssr option to disable server-rendering. Make sure you dynamically load Oversite component as follow: (read more details here)

app/components/oversiteNoSSR.js
import dynamic from "next/dynamic";

/** Dynamically load Oversite without SSR, only way to get access to browser APIs needed by Oversite */
export default dynamic(() => import("./oversite"), {
ssr: false,
});

Lastly, you need to load Oversite into your pages. We recommend you doing that at Root layout or Template level:

app/template.js
import Oversite from "./components/OversiteNoSSR";

export default function Template({ children }) {
return <Oversite />; //Must only be mounted on your preview enviroment
}

Developers Ressources

Terminology

TermDescription
OversiteOversite overlays your preview site with our Dock and others UI elements that provide access to Perfection features.
Admin PanelThe Admin Panel is the place where you manage all your Perfection features at https://app.perfection.dev/
CLIThe Perfection CLI is a Command Line Interface for interacting with Perfection's SaaS infrastructure, such as to synchronize configuration files.
SaaSSoftware-as-a-Service. You don't install Perfection to your infrastructure; your pages and users access Perfection's infrastructure.
ProvidersYou use the Admin Panel or CLI to configure providers, which abstract access to your back-end systems such as CMS and commerce.
ThemesThemes define the features available to users for controlling page presentation options.
APIPerfection's service API exposes all functionality through a RESTful programming interface.
Deep LinksClicking a deep link in the preview version of the website opens the underlying record in the source system, such as CMS or commerce.