
Research
GemStuffer Campaign Abuses RubyGems as Exfiltration Channel Targeting UK Local Government
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.
phoenix_typed_hook
Advanced tools
Write your Phoenix LiveView client hooks using typed classes, with or without TypeScript.
See autocomplete available in VS Code by using it:

Custom LiveView client hooks are defined as plain objects implementing callbacks such as mounted, updated, etc.
Since they're plain objects, there is no typing involved, so code editors can't provide code completion for attributes available, and also can't do compile-time checks (this last one, when TypeScript is used).
This package allows those features, by introducing a typed base hook class you can extend from, and a function to convert this class to a format that Phoenix LiveView understands.
Once installed, define your hook as a class that extends Hook, and convert it using makeHook:
import { Hook, makeHook } from "phoenix_typed_hook";
class MyHook extends Hook {
mounted() {
this.el.style.color = "red";
this.handleEvent("foo", (payload) => {});
}
}
export default makeHook(MyHook);
Then, pass the hook as usual to the LiveSocket constructor options.
import MyHook from "./hooks/my_hook";
const hooks = { MyHook };
const liveSocket = new LiveSocket("/live", Socket, { hooks, ... });
Phoenix Typed Hook can be installed via NPM or Mix.
In your project directory, go to the assets folder (cd assets) and run npm install phoenix_typed_hook --save
Using Hex to install Phoenix Typed Hook requires more steps compared to NPM, but allows you to manage its version on mix.exs, closer to where the Phoenix LiveView version is also declared. This makes it easier to remember to upgrade them together.
Add phoenix_typed_hook to the list of dependencies in mix.exs:
def deps do
[
{:phoenix_typed_hook, "~> 0.18.2"}
]
end
And run mix deps.get.
After that, open assets/package.json of your project (create it if it doesn't exist), and add phoenix_typed_hook to the list of dependencies:
{
"dependencies": {
"phoenix_typed_hook": "file:../deps/phoenix_typed_hook"
}
}
And run npm install inside the assets folder.
FAQs
Write your Phoenix LiveView client hooks using typed classes
The npm package phoenix_typed_hook receives a total of 436 weekly downloads. As such, phoenix_typed_hook popularity was classified as not popular.
We found that phoenix_typed_hook 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
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.

Research
Socket detected 84 compromised TanStack npm package artifacts modified with suspected CI credential-stealing malware.