
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@blocklet/did-space-react
Advanced tools
This package provides React components designed to help you seamlessly integrate and interact with DID Space. With these components, you can easily enable users to connect to and display information about their DID Space.
# install
npm install @blocklet/did-space-react
This package includes two key components:
The DIDSpaceConnect component enables users to establish a connection with DID Space. Here are the main usage scenarios:
This component allows you to easily create a button on the page to connect to a DID Space. After clicking the button and successfully connecting to the DID Space, the system will return a spaceGateway object, which contains information such as the DID Space's name, DID, and site URL. You can choose how to store this object based on your needs.
Example:
import Toast from '@arcblock/ux/lib/Toast';
import { DIDSpaceConnect, type DIDSpaceGateway } from '@blocklet/did-space-react';
export default function Demo() {
const onSuccess = async ({ spaceGateway }: { spaceGateway: DIDSpaceGateway }) => {
try {
// do something with spaceGateway
} catch (error) {
console.error(error);
Toast.error(formatError(error));
}
};
return <DIDSpaceConnect {...rest} onSuccess={onSuccess} />;
}
When users connect to DID Space for the first time, the DIDSpaceConnect component will automatically save the spaceGateway to their account. This data can later be retrieved through session.user.didSpace.
Example:
import { DIDSpaceConnect } from '@blocklet/did-space-react';
export default function Demo() {
const session = useSessionContext();
return <DIDSpaceConnect session={session} />;
}
If the user needs to reconnect to a previously linked DID Space, you need to set reconnect to true and provide spaceDid and spaceGatewayUrl props. This turns the component into a reconnect button that triggers a reconnection request.
Example:
import { DIDSpaceConnect } from '@blocklet/did-space-react';
export default function Demo() {
const session = useSessionContext();
const { did, url } = session.user?.didSpace ?? {};
if (did && url) {
return <DIDSpaceConnect reconnect spaceDid={did} spaceGatewayUrl={url} />;
}
return null;
}
The DIDSpaceConnection component is a versatile UI element designed to display key information about the connected DID Space. It enhances the user experience by providing context and interactivity.
Key Features:
Example:
import { DIDSpaceConnection } from '@blocklet/did-space-react';
export default function Demo() {
// This is just a sample template, the actual endpoint address can be obtained from `spaceGateway.endpoint`
const endpoint = 'https://${spaceDomain}/app/api/space/${spaceDid}/app/${appDid}/object/';
return (
<>
{/* basic use */}
<DIDSpaceConnection endpoint={endpoint} selected />
{/* enforce compat layout */}
<DIDSpaceConnection endpoint={endpoint} selected compat />
</>
);
}
You can enhance the DIDSpaceConnection by customizing the action buttons through the action attribute. This allows you to tailor the functionality to your specific application needs.
Example:
import { DIDSpaceConnection } from '@blocklet/did-space-react';
export default function Demo() {
const endpoint = 'https://${spaceDomain}/app/api/space/${spaceDid}/app/${appDid}/object/';
return (
<DIDSpaceConnection
endpoint={x.endpoint}
selected
action={({ spaceGateway, selected, refresh }) => (
// open DID Space site
<IconButton
size="small"
LinkComponent={Link}
href={`${spaceGateway.url}/space/${spaceGateway.did}`}
target="_blank"
>
<OpenInNewIcon />
</IconButton>
)}
/>
);
}
You can customize the footer content of DIDSpaceConnection through the footer attribute. By default, when footer is set to true, it displays the latest audit log information. You can also provide your own custom footer content.
Example 1: Display the latest audit log by default
import { DIDSpaceConnection } from '@blocklet/did-space-react';
export default function Demo() {
const endpoint = 'https://${spaceDomain}/app/api/space/${spaceDid}/app/${appDid}/object/';
return <DIDSpaceConnection endpoint={x.endpoint} selected footer />;
}
Example 2: Custom Footer Content
import { DIDSpaceConnection } from '@blocklet/did-space-react';
export default function Demo() {
const endpoint = 'https://${spaceDomain}/app/api/space/${spaceDid}/app/${appDid}/object/';
return (
<DIDSpaceConnection
endpoint={x.endpoint}
selected
footer={({ spaceGateway, selected, refresh, originalFooter }) => (
<>
{/* display the latest audit log */}
{originalFooter}
{/* display DID Space version number */}
<Box display="flex" alignItems="center">
<Typography>{spaceGateway.version}</Typography>
</Box>
</>
)}
/>
);
}
FAQs
Reusable react components for did space
We found that @blocklet/did-space-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.