
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pcp-protocol
Advanced tools
Typed JavaScript/TypeScript client for interacting with the PCP browser extension from React, Next.js, and standard web applications.
pcp)usePCP) for effortless integrationnpm install pcp
# or
pnpm add pcp
# or
yarn add pcp
Note: Make sure the PCP browser extension is installed and the user is signed in.
import { usePCP } from "pcp";
export default function ContextPanel() {
const { status, loading, error, requestAccess, fetchData } = usePCP();
return (
<div>
<button onClick={requestAccess} disabled={loading}>
{status.connected ? "Re-request Access" : "Request PCP Access"}
</button>
<button onClick={() => fetchData().then(console.log)} disabled={!status.connected || loading}>
Fetch Context Data
</button>
{error && <p style={{ color: "red" }}>{error.message}</p>}
{status.connected && <p>Link expires at: {new Date(status.link!.expires_at).toLocaleString()}</p>}
</div>
);
}
If you render PCP-dependent UI on the server, guard for the browser:
import dynamic from "next/dynamic";
const SafeContextPanel = dynamic(() => import("../components/ContextPanel"), {
ssr: false,
});
export default function Page() {
return <SafeContextPanel />;
}
<script type="module">
import { requestAccess, fetchData } from "https://cdn.skypack.dev/pcp";
async function start() {
try {
const link = await requestAccess();
console.log("Access granted", link);
const data = await fetchData();
console.log("Context data", data);
} catch (error) {
console.error("PCP error", error);
}
}
start();
</script>
import {
requestAccess,
getStatus,
fetchData,
getCurrentLink,
isConnected,
ensureConnected,
} from "pcp";
requestAccess(): Promise<PCPLink> – Opens the extension prompt and returns the issued linkgetStatus(): Promise<PCPStatus> – Current connection statefetchData<T = unknown>(): Promise<T> – Fetches user context data from SupabasegetCurrentLink(): PCPLink | null – Cached link (if available)isConnected(): boolean – Synchronous connection checkensureConnected(): Promise<PCPLink> – Makes sure a valid link exists, requesting one if necessaryimport { usePCP } from "pcp";
const {
status,
loading,
error,
requestAccess,
fetchData,
ensureConnected,
isConnected,
currentLink,
} = usePCP({ autoConnect: true, refreshIntervalMs: 5000 });
status – { connected: boolean; link: PCPLink | null }loading – Indicates in-flight operationserror – Last error encountered (if any)requestAccess() – Prompts the extensionfetchData() – Fetches context dataensureConnected() – Ensures a valid link is presentisConnected / currentLink – Derived convenience valuesBuild the package
pnpm install # or npm install
pnpm build # outputs to dist/
Test locally (optional)
pnpm link --global
# In your app
pnpm link --global pcp
Publish to npm
npm publish --access public
Ensure the package.json fields (name, version, author, etc.) are correct before publishing.
window)usePCP hooklibrary/
package.json
tsconfig.json
src/
core.ts # Core logic (no React)
usePCP.ts # React hook
index.ts # Public exports
MIT – free for commercial and personal use.
FAQs
Personal Context Protocol client library for web and React applications
We found that pcp-protocol demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.