
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@firecms/collection_editor
Advanced tools
This plugin enables creating and managing Firestore collections directly from your FireCMS interface. It adds a visual collection editor that allows you to create, edit, and delete collections without writing code.
npm install @firecms/collection_editor
# or
yarn add @firecms/collection_editor
For Firebase integration, also install:
npm install @firecms/collection_editor_firebase
# or
yarn add @firecms/collection_editor_firebase
import React from "react";
import { FireCMS } from "@firecms/core";
import { useCollectionEditorPlugin } from "@firecms/collection_editor";
import { useFirestoreCollectionsConfigController } from "@firecms/collection_editor_firebase";
export default function App() {
// Controller to save collection configs in Firestore
const collectionConfigController = useFirestoreCollectionsConfigController({
firebaseApp
});
// Initialize the collection editor plugin
const collectionEditorPlugin = useCollectionEditorPlugin({
collectionConfigController
});
const navigationController = useBuildNavigationController({
// Your other config options
plugins: [collectionEditorPlugin]
});
return <FireCMS
name={"My CMS"}
navigationController={navigationController}
authentication={myAuthenticator}
firebaseConfig={firebaseConfig}
/>;
}
You can customize collection editor behavior with these options:
const collectionEditorPlugin = useCollectionEditorPlugin({
collectionConfigController, // Required: controller that handles persistence
// Define permissions for collection operations
configPermissions: ({ user }) => ({
createCollections: user.roles?.includes("admin") ?? false,
editCollections: user.roles?.includes("admin") ?? false,
deleteCollections: user.roles?.includes("admin") ?? false
}),
// Prevent these group names from being used
reservedGroups: ["admin", "system"],
// Optional custom view to add to the editor
extraView: {
View: MyCustomView,
icon: <CustomIcon />
},
// Function to infer collection structure from existing data
collectionInference: async ({ path }) => {
// Return inferred schema based on data at path
},
// Function to get sample data for a collection
getData: async (path, parentPaths) => {
// Return sample data for the specified path
},
// Track collection editor events
onAnalyticsEvent: (event, params) => {
console.log("Collection editor event:", event, params);
},
// Include introduction widget when no collections exist
includeIntroView: true
});
You can combine collections defined in code with those created in the UI:
import { mergeCollections } from "@firecms/collection_editor";
const collectionsBuilder = useCallback(() => {
// Collections defined in code
const codeCollections = [productsCollection, ordersCollection];
// Merge with collections from the editor UI
return mergeCollections(codeCollections, collectionConfigController.collections ?? []);
}, [collectionConfigController.collections]);
const navigationController = useBuildNavigationController({
collections: collectionsBuilder,
// Other options
});
To persist collections in Firestore:
const collectionConfigController = useFirestoreCollectionsConfigController({
firebaseApp,
// Optional: specify where to save configs (default: "__FIRECMS/config/collections")
configPath: "custom/config/path",
// Optional: define permissions for collections
permissions: ({ user }) => ({
// Your permissions logic
}),
// Optional: custom property configurations
propertyConfigs: [
// Custom property types
]
});
FireCMS offers several complementary plugins:
FAQs
Unknown package
The npm package @firecms/collection_editor receives a total of 695 weekly downloads. As such, @firecms/collection_editor popularity was classified as not popular.
We found that @firecms/collection_editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.