
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@insforge/shared
Advanced tools
Shared utilities, types, and React contexts for Insforge packages.
This package centralizes React Context definitions to prevent duplication issues when using tsup with multiple entry points. By defining contexts here, all Insforge packages (@insforge/react, @insforge/nextjs, etc.) import from the same source, ensuring a single Context instance.
Inspired by @clerk/shared, this package solves the Context duplication problem:
When using bundle: true with multiple entry points:
// tsup.config.ts
entry: {
index: 'src/index.ts',
hooks: 'src/hooks/index.ts',
components: 'src/components/index.ts'
}
Each entry point bundles its own copy of Context → Provider uses Context instance A, but components use Context instance B → useContext returns undefined.
@insforge/sharedreact as external in tsup config@insforge/shared// packages/shared/tsup.config.ts
export default defineConfig({
external: ['react', 'react-dom'], // Critical!
bundle: true,
});
@insforge/shared)import type { InsforgeUser, InsforgeContextValue, OAuthProvider } from '@insforge/shared';
@insforge/shared/react)import { InsforgeContext } from '@insforge/shared/react';
This package is intended for internal use within the Insforge monorepo. Application developers should not need to import from it directly.
MIT
FAQs
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
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.