Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@agility/app-sdk

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agility/app-sdk

JavaScript library for building Agility CMS apps.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Agility CMS App SDK

This is a React SDK for building UI Apps for Agility CMS.

Local Development

If you want to develop this SDK locally and test it in another project, follow these steps:

Step 1: Clone and Install Dependencies

First, clone the repository and install dependencies.

git clone https://github.com/agility/agility-cms-app-sdk.git
cd agility-cms-app-sdk
yarn install

Step 2: Build the SDK

Before using the SDK in your local project, build the package using the following command:

yarn build

This will clean, compile, and bundle the SDK, placing the output in the dist folder.

To use the SDK in your local project, you can use yarn link. This allows your local project to reference the SDK directly without needing to publish it to npm.

cd agility-cms-app-sdk
yarn link

Step 4: Using the SDK in Your Project

Once the SDK is linked, you can link it to your project:

cd your-project
yarn link "@agility/app-sdk"

At this point, your project will use the local version of the SDK.

Step 5: Watching for Changes

If you're actively developing the SDK, you can start the watch mode for continuous builds:

cd agility-cms-app-sdk
yarn watch

This will watch for changes and rebuild the SDK as needed.

Avoiding React Linking:

To avoid conflicts between React versions, React is treated as a peer dependency and is not bundled with the SDK. This ensures that your project provides the React version, and you don't need to manually link React.

You may run into issues trying link to apps that are using Next.JS. If you can an error like that you can try to add the following to your next.config.js:

webpack: (config) => {
		config.resolve.alias = {
			...config.resolve.alias,
			react: path.resolve(__dirname, "node_modules/react"),
			"react-dom": path.resolve(__dirname, "node_modules/react-dom")
		}
		return config
	},

Notes On Peer Dependencies

  • Peer Dependencies: The SDK expects your project to provide its own version of react and react-dom that meets the version requirements specified in the SDK’s peerDependencies.
  • Shared React: As long as your project provides a compatible React version, everything will work without requiring manual linking.

This setup prevents version conflicts, avoids the need for linking React manually, and ensures that your project and the SDK share the same React instance.

Unlinking the SDK

To unlink the SDK from your project, run the following command:

In your project:

cd your-project
yarn unlink "@agility/app-sdk"

In the SDK:

cd agility-cms-app-sdk
yarn unlink

This will restore the original packages from npm in both your SDK and the project.

Example Apps

One of the best ways to learn a new SDK is to see some examples! Check out these sample apps to help you get started:

Google Analytics

A dashboard app that uses OAuth to connect to Google and pull Google Analytics data.

Google Translate

A sidebar app that translates and detects language for the current content item.

BigCommerce

A custom field app that allows selection of a product from BigCommerce. It includes a modal with a product listing and search component.

FAQs

Package last updated on 19 Nov 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc