Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dscvr-one/canvas-client-sdk
Advanced tools
SDK for iframes apps to connect to dscvr host using postMessage rpc
This SDK can be used by DSCVR Canvas Applications to communicate with the DSCVR Frontend.
Current features include:
Install with your favorite package manager:
npm install @dscvr-one/canvas-client-sdk
yarn
yarn add @dscvr-one/canvas-client-sdk
To use the SDK:
CanvasClient
and CanvasInterface
into your typescript project:import {
createCanvasClient,
type CanvasInterface,
type CanvasClient,
} from '@dscvr-one/canvas-client-sdk';
CanvasClient
:const canvasClient = createCanvasClient();
const response = await canvasClient.ready();
//
if (response) {
// The handshake allows access to the user and the content that the application is embedded in.
const user: CanvasInterface.Handshake.User = response.untrusted.user;
const content: CanvasInterface.Handshake.Content = response.untrusted.content;
// ...
}
If the client is being instantiated in a react hook or in a vue component/composable (anything with a lifecycle),
we recommend to destroy the client on hot refreshes to avoid CanvasInterface.ClientAlreadyInitializedError
while on localhost.
e.g Vue
onMounted(() => {
canvasClient = createCanvasClient();
if (!canvasClient) return;
response = await canvasClient.ready();
});
onUnmounted(() => {
canvasClient?.destroy();
});
e.g React
useEffect(() => {
canvasClient = createCanvasClient();
if (canvasClient) {
response = await canvasClient.ready();
}
// Destroy the client on effect cleanup
return () => {
canvasClient?.destroy();
};
});
Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
FAQs
SDK for iframes apps to connect to dscvr host using postMessage rpc
We found that @dscvr-one/canvas-client-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.