
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@cfce/registry-hooks
Advanced tools
Registry events can trigger web3 actions, such as adding metadata to an NFT, or creating story certificates
[ ] Handle errors
Initialize registry hooks using a registry API key
import { init } from '@cfce/registry-hooks';
init({
registryApiKey: process.env.CFCE_REGISTRY_API_KEY,
registryBaseUrl: 'https://registry.staging.cfce.io/api', // optional, for if you want to use the staging version, which you probably do
});
Wherever you want to run a given hook, use the runHook function.
mintNFT() {
import {runHook, Triggers} from '@cfce/registry';
const initialMetadata = {a: 1};
// runHook takes 3 params. 1. The Trigger name 2. The organizations to check and 3. Additional data that can be used by the the hook (currently just the below)
const extraMetadata = runHook(Triggers.addMetadataToNFTReceiptReceipt, organizationId, {userId, walletId, organizationId}); // include metadata that might be used by the hooks.
}
Actions operate based on the context that's passed into them, and then have access to the context of all the actions that came before. When the hook is first called, the context that's passed in is assigned to input
The input context is special in two ways. First, it injects information that may be useful for the hook, such as the wallet address of the donor. Second, it includes special values, currently just date, which is a timestamp at the time of execution of the hook. This date value can be used with the math action to add a date filter to an API request, for example.
This package provides the following main actions:
fetchDataFromApi(context, parameters)Fetches data from an API. The context is an object that stores data as it passes through the hook. The parameters object should have the following properties:
endpoint: The API endpoint to fetch data from.method: The HTTP method to use.body: The body of the request.headers: The headers of the request.Example usage:
import { fetchDataFromApi } from '@cfce/registry/src/actions';
fetchDataFromApi(context, {
endpoint: 'https://api.example.com/data',
method: 'GET',
body: {},
headers: {
'Content-Type': 'application/json',
},
});
Performs a mathematical operation. The context is an object that stores data as it passes through the hook. The parameters object should have the following properties:
Example usage:
import { math } from '@cfce/registry/src/actions';
math(context, {
operation: 'add',
operands: [1, 2, 3, 4, 5],
});
Transforms data. The context is an object that stores data as it passes through the hook. The parameters object should have the following properties:
import { transform } from '@cfce/registry/src/actions';
transform(context, {
path: 'data.value',
value: 'newValue',
});
Creates a story. The context is an object that stores data as it passes through the hook. The parameters object should have the following properties:
Example usage:
import { createStory } from '@cfce/registry/src/actions';
createStory(context, {
title: 'My Story',
content: 'Once upon a time...',
});
Creates multiple stories. The context is an object that stores data as it passes through the hook. The parameters object should be an array where each element is an object with the following properties:
Example usage:
import { createStories } from '@cfce/registry/src/actions';
createStories(context, [
{
title: 'My First Story',
content: 'Once upon a time...',
},
{
title: 'My Second Story',
content: 'In a land far, far away...',
},
]);
Transforms each item in the data. The context is an object that stores data as it passes through the hook. The parameters object should have the following properties:
Example usage:
import { transformEach } from '@cfce/registry/src/actions';
transformEach(context, {
path: 'data.values',
value: 'newValue',
});
/src/actions foldersrc/actions/index.ts, add your action to the Actions type and to the exported actionssrc/types.ts, add the action to the ActionTypes const and add the params to ContextParamssrc/actions/__tests__FAQs
Registry events can trigger web3 actions, such as adding metadata to an NFT, or creating story certificates
We found that @cfce/registry-hooks demonstrated a not healthy version release cadence and project activity because the last version was released 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.