
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.
@deskpro/app-sdk
Advanced tools
Deskpro Apps SDK provides a client for communicating with the Deskpro system, React UI components as well as basic styles and utilities for use in simple apps and widgets.
Install the SDK via pnpm
or npm
:
pnpm add @deskpro/app-sdk
OR
npm install @deskpro/app-sdk
When communicating with the Deskpro system, an app or widget must register "listeners" for key events:
To register a listener you'll need to first import and create a Deskpro client, register the listener(s) and then lastly run the client:
import { createClient } from "@deskpro/app-sdk";
const client = createClient();
client.onReady((context) => {
// do something when the app is ready
});
client.onShow((context) => {
// do something when the app is shown to the user
});
client.onChange((context) => {
// do something when the "context" data has changed
});
client.run();
As an aside, it's always best to "run" the client after the page is loaded, the easiest way to do
this is to register the client.run()
call as a window.onload
method:
import { createClient } from "@deskpro/app-sdk";
const client = createClient();
window.onload = () => client.run();
// ...
To make fetch
requests via the app proxy, and therefore gain access to app settings, we've provided
a utility that wraps the native fetch
function in the browser:
import { createClient, proxyFetch } from "@deskpro/app-sdk";
const client = createClient();
window.onload = () => client.run();
proxyFetch(client).then((dpFetch) => {
// Use dpFetch() just like you would use fetch() natively.
dpFetch("https://example.com/api/things?api_key=__key__").then((res) => {
// ...
});
});
Notice that the proxy will replace placeholders with the format __<setting>__
. In this example, __key__
will
be replaced with the app backend setting key
. Proxy setting placeholders may be placed in the URL,
headers or body of the request.
You can also control aspects of Deskpro itself, like the app title and icon badge count. To do this, use the client again to set these properties:
import { createClient } from "@deskpro/app-sdk";
const client = createClient();
window.onload = () => client.run();
client.setTitle("My New Title");
client.setBadgeCount(42);
The Apps SDK exports several Deskpro UI components and is supported by a published Storybook story of each.
All app UI components reside in src/ui/components
and usually consist of three files each:
Button.tsx
that exports or compounds the componentButton.stories.tsx
that contains the story for the componentTo start developing UI components, run Storybook with:
pnpm start
When you're ready to build, run the standard build process for this library:
pnpm build
Note: UI components are not bundled, instead they're available in the ESM and CJS module builds.
To run the SDK test suite, execute the following:
pnpm test
OR
npm run test
FAQs
Deskpro Apps SDK
The npm package @deskpro/app-sdk receives a total of 471 weekly downloads. As such, @deskpro/app-sdk popularity was classified as not popular.
We found that @deskpro/app-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
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.