In order to add the Plenti CMS to your site you need to use 3 magic variables (contentuser, and adminMenu) that are provided to you by the Plenti.

You have a great deal of flexibility in how to implement these (or not) on your site. Commonly you will add the admin menu to your entrypoint file in a manner similar to this:

  export let content, user, adminMenu;

<html lang="en">
    {#if user && $user.isAuthenticated}
      <svelte:component this={adminMenu} bind:content {user} />
      <svelte:component this={layout} {...content.fields} {user} />

Then on whatever page or popup you want to use to display the login, you can simply add something like this:

<button on:click|preventDefault={$user.login()}>

For logout, there's a link provided to you by default in the admin menu, but you can implement your own workflow using:

<button on:click|preventDefault={$user.logout()}>

The information above is enough to get you up and running locally. If you make changes through the admin interface, it will update your JSON locally, which you can then commit or discard with Git.

Remote / Deployed CMS

If you want to use the CMS on a deployed website, or hand it off to clients who don't use Git, you can configure a remote repository in your sitewide plenti.json configuration file:

"cms": {
  "repo": "",
  "redirect_url": "",
  "app_id": "put oauth id here",
  "branch": "main"