
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@differentialhq/core
Advanced tools
This is the official Differential SDK for Typescript.
npm install @differentialhq/core
yarn add @differentialhq/core
pnpm add @differentialhq/core
Create a file named d.ts which will be used to initialize Differential. This file will export the Differential instance.
// d.ts
import { Differential } from "@differentialhq/core";
// Initialize Differential with your API secret.
// Get yours at https://console.differential.dev.
export const d = new Differential("YOUR_API_SECRET");
In a separate file, create the "Hello World" service. This file will import the Differential instance from d.ts and define the service.
// service.ts
import { d } from "./d";
// Define a simple function that returns "Hello, World!"
const sayHello = async (to: string) => {
return `Hello, ${to}!`;
};
// ...and as many other functions as you want, any async function can be a service operation
const callEndpoint = async () => {
return fetch("https://api.example.com");
};
// Register the function as a service
export const helloWorldService = d.service({
name: "helloWorld",
functions: {
sayHello,
callEndpoint,
},
});
When calling the service, use the typeof generic to ensure type safety. This can be done in any file where you need to call the service, like a test file or another service file.
// service-consumer.ts
import { d } from "./d";
import type { helloWorldService } from "./service";
const client = d.client<typeof helloWorldService>("helloWorld");
async function test() {
const greeting = await client.sayHello("World");
console.log(greeting); // Outputs: Hello, World!
}
test();
To run the service, simply run the file with the service definition. This will start the service and make it available to other services.
tsx service.ts
and then you can invoke the service from another file:
tsx service-consumer.ts
FAQs
Javascript SDK for differential.dev
The npm package @differentialhq/core receives a total of 10 weekly downloads. As such, @differentialhq/core popularity was classified as not popular.
We found that @differentialhq/core 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.