Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@agility/web-studio-sdk

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agility/web-studio-sdk

Standard Development Kit used to enable Web Studio features in Agility CMS

Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
109
26.74%
Maintainers
0
Weekly downloads
 
Created
Source

Web Studio SDK

This is the official JavaScript/TypeScript SDK for Agility CMS's Web Studio.

Don't have an Agility CMS instance? Sign up for Free Trial today!

Features

  • Enable your website/app to use the new Web Studio features.
  • Add the ability to collaborate and comment directly on your website/app.
  • Empower your editors to preview content changes in real-time.

Getting Started

You'll need to have an Agility CMS instance to use this SDK. If you don't have one, you can sign up for a Free Trial today!

Once you have an Agility CMS Instance you will need to install the sdk from npm and add a script tag in your website.

<script src="https://unpkg.com/@agility/web-studio-sdk@latest/dist/index.js"></script>

You can stop there if you'd like. But to get the most of the SDK, you'll need to decorate your components, fields, and pages with the data-agility-* attributes. This will allow the SDK to interact with your website/app, and enable real-time editing. You'll also need to add your guid as a data-agility-guid attribute to the root element of your website/app.

<!DOCTYPE html>
<html lang="en" data-agility-guid="YOUR_GUID">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div data-agility-page="YOUR_PAGE_ID">
      <header data-agility-component="YOUR_CONTENT_ID">
        <h1 data-agility-field="title">{{fields.title}}</h1>
        <p data-agility-field="content">{{field.content}}</p>
      </header>
    </div>
  </body>
</html>

Installation

npm

npm install @agility/web-studio-sdk

yarn

yarn add @agility/web-studio-sdk

Running This Project Locally

You will need to have an Agility CMS instance and a website that you can also run locally. In the root of your site, add the following script tag

<script src="http://127.0.0.1:8080/index.js"></script>
  • Clone this repository

  • Run npm install

  • Run npm run dev

  • On the Sitemaps page in Agility CMS, add a preview deployment that points at where your website is running locally, usually http://localhost:3000.

  • Go to the Pages module in Agility CMS and click on the "Preview" button to see the Web Studio in action.

Also here is a handy Regex that's useful for debugging frame events in the chrome dev tools console:

/^Web Studio (SDK|CMS)/

Resources

For docs & help around Agility CMS, please see Agility CMS Documentation

Tutorials

Contributing

If you would like to contribute to this SDK, you can fork the repository and submit a pull request. We'd love to include your updates.

Keywords

typescript

FAQs

Package last updated on 08 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts