Sign In

@insforge/shared

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@insforge/shared - npm Package Compare versions

Comparing version
1.1.3
to
1.1.4
+4
-0
dist/index.d.cts

@@ -72,2 +72,6 @@ import { UserSchema, CreateSessionResponse, AuthOptions, CreateUserResponse, ResetPasswordResponse, VerifyEmailResponse, OAuthProvidersSchema, GetPublicAuthConfigResponse } from '@insforge/shared-schemas';

getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
getSession: () => Promise<{
accessToken: string;
user: InsforgeUser;
} | null>;
}

@@ -74,0 +78,0 @@ /**

@@ -72,2 +72,6 @@ import { UserSchema, CreateSessionResponse, AuthOptions, CreateUserResponse, ResetPasswordResponse, VerifyEmailResponse, OAuthProvidersSchema, GetPublicAuthConfigResponse } from '@insforge/shared-schemas';

getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
getSession: () => Promise<{
accessToken: string;
user: InsforgeUser;
} | null>;
}

@@ -74,0 +78,0 @@ /**

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/react/contexts.tsx"],"names":["createContext"],"mappings":";;;;;AAmBO,IAAM,eAAA,GAAkBA,oBAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2BA,oBAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyBA,oBAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwBA,oBAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.cjs","sourcesContent":["import { createContext } from 'react';\nimport type {\n InsforgeContextValue,\n InsforgeAuthState,\n InsforgeAuthMethods,\n InsforgeAuthConfig,\n} from '../types';\n\n/**\n * InsforgeContext - The single source of truth for authentication state\n *\n * This Context is defined in @insforge/shared to prevent duplication across\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\n * import this Context definition, ensuring there's only ONE Context instance.\n *\n * Pattern learned from @clerk/shared\n *\n * @deprecated Internal use only. Use useInsforge() hook instead.\n */\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\nInsforgeContext.displayName = 'InsforgeContext';\n\n/**\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\n *\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\n * It updates when auth state changes.\n */\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\n\n/**\n * InsforgeMethodsContext - Stable method references\n *\n * This context holds method references that NEVER change once initialized.\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\n * This prevents useEffect re-runs when state changes.\n *\n * Pattern learned from @clerk/shared - they store the Clerk instance\n * in a separate context to keep method references stable.\n */\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\n\n/**\n * InsforgeConfigContext - Static configuration values\n *\n * This context holds configuration values like baseUrl, afterSignInUrl.\n * These rarely change after initialization.\n */\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\n"]}
{"version":3,"sources":["../src/react/contexts.tsx"],"names":["createContext"],"mappings":";;;;;AAmBO,IAAM,eAAA,GAAkBA,oBAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2BA,oBAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyBA,oBAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwBA,oBAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.cjs","sourcesContent":["import { createContext } from 'react';\r\nimport type {\r\n InsforgeContextValue,\r\n InsforgeAuthState,\r\n InsforgeAuthMethods,\r\n InsforgeAuthConfig,\r\n} from '../types';\r\n\r\n/**\r\n * InsforgeContext - The single source of truth for authentication state\r\n *\r\n * This Context is defined in @insforge/shared to prevent duplication across\r\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\r\n * import this Context definition, ensuring there's only ONE Context instance.\r\n *\r\n * Pattern learned from @clerk/shared\r\n *\r\n * @deprecated Internal use only. Use useInsforge() hook instead.\r\n */\r\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\r\nInsforgeContext.displayName = 'InsforgeContext';\r\n\r\n/**\r\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\r\n *\r\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\r\n * It updates when auth state changes.\r\n */\r\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\r\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\r\n\r\n/**\r\n * InsforgeMethodsContext - Stable method references\r\n *\r\n * This context holds method references that NEVER change once initialized.\r\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\r\n * This prevents useEffect re-runs when state changes.\r\n *\r\n * Pattern learned from @clerk/shared - they store the Clerk instance\r\n * in a separate context to keep method references stable.\r\n */\r\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\r\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\r\n\r\n/**\r\n * InsforgeConfigContext - Static configuration values\r\n *\r\n * This context holds configuration values like baseUrl, afterSignInUrl.\r\n * These rarely change after initialization.\r\n */\r\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\r\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\r\n"]}

@@ -1,1 +0,1 @@

{"version":3,"sources":["../src/react/contexts.tsx"],"names":[],"mappings":";;;AAmBO,IAAM,eAAA,GAAkB,cAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2B,cAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyB,cAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwB,cAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.js","sourcesContent":["import { createContext } from 'react';\nimport type {\n InsforgeContextValue,\n InsforgeAuthState,\n InsforgeAuthMethods,\n InsforgeAuthConfig,\n} from '../types';\n\n/**\n * InsforgeContext - The single source of truth for authentication state\n *\n * This Context is defined in @insforge/shared to prevent duplication across\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\n * import this Context definition, ensuring there's only ONE Context instance.\n *\n * Pattern learned from @clerk/shared\n *\n * @deprecated Internal use only. Use useInsforge() hook instead.\n */\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\nInsforgeContext.displayName = 'InsforgeContext';\n\n/**\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\n *\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\n * It updates when auth state changes.\n */\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\n\n/**\n * InsforgeMethodsContext - Stable method references\n *\n * This context holds method references that NEVER change once initialized.\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\n * This prevents useEffect re-runs when state changes.\n *\n * Pattern learned from @clerk/shared - they store the Clerk instance\n * in a separate context to keep method references stable.\n */\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\n\n/**\n * InsforgeConfigContext - Static configuration values\n *\n * This context holds configuration values like baseUrl, afterSignInUrl.\n * These rarely change after initialization.\n */\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\n"]}
{"version":3,"sources":["../src/react/contexts.tsx"],"names":[],"mappings":";;;AAmBO,IAAM,eAAA,GAAkB,cAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2B,cAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyB,cAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwB,cAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.js","sourcesContent":["import { createContext } from 'react';\r\nimport type {\r\n InsforgeContextValue,\r\n InsforgeAuthState,\r\n InsforgeAuthMethods,\r\n InsforgeAuthConfig,\r\n} from '../types';\r\n\r\n/**\r\n * InsforgeContext - The single source of truth for authentication state\r\n *\r\n * This Context is defined in @insforge/shared to prevent duplication across\r\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\r\n * import this Context definition, ensuring there's only ONE Context instance.\r\n *\r\n * Pattern learned from @clerk/shared\r\n *\r\n * @deprecated Internal use only. Use useInsforge() hook instead.\r\n */\r\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\r\nInsforgeContext.displayName = 'InsforgeContext';\r\n\r\n/**\r\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\r\n *\r\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\r\n * It updates when auth state changes.\r\n */\r\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\r\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\r\n\r\n/**\r\n * InsforgeMethodsContext - Stable method references\r\n *\r\n * This context holds method references that NEVER change once initialized.\r\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\r\n * This prevents useEffect re-runs when state changes.\r\n *\r\n * Pattern learned from @clerk/shared - they store the Clerk instance\r\n * in a separate context to keep method references stable.\r\n */\r\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\r\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\r\n\r\n/**\r\n * InsforgeConfigContext - Static configuration values\r\n *\r\n * This context holds configuration values like baseUrl, afterSignInUrl.\r\n * These rarely change after initialization.\r\n */\r\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\r\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\r\n"]}
{
"name": "@insforge/shared",
"version": "1.1.3",
"version": "1.1.4",
"description": "Shared utilities and React contexts for Insforge packages",

@@ -5,0 +5,0 @@ "type": "module",