One of the UI locations of Uniform.app extensibility is the left siderail within Canvas and Entry editor, and it is called "Editor Tools".
This is an example app that is installed as a custom Uniform integration showing how to implement your own functionality of copying a currently selected composition to a target Uniform project, which is configurable in the integration settings.
Uniform integrations can run on localhost. This is how to set it up.
-
Copy
.env.exampleto.env -
Define
UNIFORM_API_KEY. API key should have read access to the source project AND write access to the target project to copy compositions to. -
Run
npm install -
Run
npm run dev -
Head over to Uniform team seettings, Custom Integrations and add a new custom integration using manifest definition in
mesh-manifest.json. -
Install it into your project by going into Project's
Settings->Integrations, find theEditor Tools Exampleintegration, clickAdd to project. -
Go to the integration's settings page and provide the id of the Uniform project that will be used as a target to copy the composition to.
-
Now open any composition and notice a new entry in the left siderail, that's your new integration!
When opened, it displays the custom UX built within
/pages/editorTools.tsx- displaying the current composition json (for debugging purpose) and controls to initiate the copy of the composition.
This is an example integration, so feel free to adjust accordingly. Keep in mind the following specifics:
-
The scope of the composition copy only includes the composition instance itself without it's project map node, or it's definition. Your target project must have the composition definition with matching
public idand same schema in place, otherwise the copy operation will fail.> If you'd like to have the project map node that this composition is attached to being copied as well, you can extend the `copy-composition.ts` function. -
This integration is using a "BFF" (see
/api/functions) to perform copying and workflow detail resolution server-side, so sensitiveUNIFORM_API_KEYis not exposed client-side. -
This integration extends Canvas (composition editor only). You can bring this editor tool into other editors - Entry, component pattern and entry pattern by extending the manifest with the following definitions and adjust your logic accordingly (as it currently only handles composition entity type):
"canvas": { "parameterTypes": [], "editorTools": { "composition": { "url": "/editorTools" }, "componentPattern": { "url": "/editorTools" }, "entry": { "url": "/editorTools" }, "entryPattern": { "url": "/editorTools" } } }
This integration can be deployed anywhere Next.js app can run following standard Next.js deployment process.
Keep in mind to:
- Setup same environment variables as you have for local development. Adjust
UNIFORM_API_KEYas needed - Change the value of
baseLocationUrl(critical) and optionallylogoIconUrlandbadgeIconUrl(for icons) to a hosted url after deployment.
"baseLocationUrl": "http://localhost:9000"Top tip: you can have more than one custom integration per environment, one for local development, and one for production version.



