Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5d19473
fix: init commit
PavelKorobchuk Sep 17, 2025
61ea330
fix: renamed all ciba/token vault methods
PavelKorobchuk Oct 1, 2025
57f554a
Merge branch 'main' of https://github.com/PavelKorobchuk/auth0-ai-sam…
PavelKorobchuk Oct 2, 2025
bf3cf87
Merge branch 'main' into AIDX-323-rename-ciba-methods
PavelKorobchuk Oct 2, 2025
7244f74
Merge branch 'main' into AIDX-323-rename-ciba-methods
PavelKorobchuk Oct 7, 2025
57e1493
fix: updated samples
PavelKorobchuk Oct 7, 2025
66cfdf3
Merge branch 'AIDX-232-rename-ciba-methods' into AIDX-323-rename-ciba…
PavelKorobchuk Oct 7, 2025
628e07e
fix: reverted changes
PavelKorobchuk Oct 7, 2025
89b01f7
fix: reverted changes 2
PavelKorobchuk Oct 7, 2025
d046622
fix: comments
PavelKorobchuk Oct 7, 2025
ae44ee1
fix: fixed issues
PavelKorobchuk Oct 7, 2025
8102b64
fix: reverted asynchronous-authorization changes
PavelKorobchuk Oct 7, 2025
576da43
fix: reverted asynchronous-authorization changes 2
PavelKorobchuk Oct 7, 2025
225b4bc
fix: dependencies fixing
PavelKorobchuk Oct 8, 2025
ae22146
fix: updated pdf-parse
PavelKorobchuk Oct 8, 2025
1ad6de2
fix: removed temp local packages
PavelKorobchuk Oct 8, 2025
7b2890a
fix: updated ai version
PavelKorobchuk Oct 8, 2025
8db075f
fix: updated ai version - revert
PavelKorobchuk Oct 8, 2025
72242f2
fix: updated examples
PavelKorobchuk Oct 10, 2025
c61ff79
fix: reverted calculator tool
PavelKorobchuk Oct 13, 2025
81c4009
Merge branch 'auth0-samples:main' into AIDX-323-rename-ciba-methods
PavelKorobchuk Oct 13, 2025
44942ac
Merge branch 'main' into AIDX-323-rename-ciba-methods
PavelKorobchuk Oct 13, 2025
44746c1
feat: local build, lint review updates
priley86 Oct 14, 2025
ddb04da
feat: default to npm in READMEs
priley86 Oct 14, 2025
6ac8cb0
fix: update package-lock
priley86 Oct 14, 2025
94e2bed
fix: fix @ai-sdk/openai version, ensure model message conversion w/ i…
priley86 Oct 14, 2025
f600416
fix: revert scope updates for now
priley86 Oct 14, 2025
9ce7fc8
feat: deprecate usage of @langchain/community calendar tool
priley86 Oct 14, 2025
88ca2dd
fix: prevent hydration errors in debugger
priley86 Oct 14, 2025
4ec3bfc
feat: auth-for-rag updates
priley86 Oct 14, 2025
a96071b
Merge remote-tracking branch 'auth0-ai-samples-master/AIDX-323-rename…
PavelKorobchuk Oct 15, 2025
b092397
fix: updated packages
PavelKorobchuk Oct 16, 2025
d785b83
Merge branch 'main' into AIDX-323-rename-ciba-methods-new
priley86 Oct 16, 2025
0ed111b
fix: code review updates
priley86 Oct 16, 2025
d3cad9a
fix: delete bun.lock
priley86 Oct 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion authenticate-users/langchain-next-js/langgraph.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"node_version": "20",
"graphs": {
"agent": "./src/lib/agent.ts:agent"
"agent": "./src/lib/agent.ts:graph"
},
"env": ".env.local",
"dependencies": ["."]
Expand Down
99 changes: 51 additions & 48 deletions authenticate-users/langchain-next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,67 +24,70 @@
"engines": {
"node": ">=18"
},
"resolutions": {
"@auth0/ai": "file:../../packages/auth0-ai-0.0.0.tgz"
},
"dependencies": {
"@auth0/ai": "^4.0.0",
"@auth0/ai-langchain": "^3.5.0",
"@auth0/nextjs-auth0": "4.4.2",
"@langchain/community": "0.3.53",
"@langchain/core": "^0.3.77",
"@langchain/langgraph": "^0.4.4",
"@langchain/openai": "0.6.1",
"@radix-ui/react-avatar": "^1.1.7",
"@radix-ui/react-checkbox": "^1.2.3",
"@radix-ui/react-dialog": "^1.1.11",
"@radix-ui/react-dropdown-menu": "^2.1.12",
"@radix-ui/react-popover": "^1.1.11",
"@radix-ui/react-slot": "^1.2.0",
"@types/pg": "^8.15.4",
"@auth0/ai": "file:../../packages/auth0-ai-0.0.0.tgz",
"@auth0/ai-langchain": "file:../../packages/auth0-ai-langchain-0.0.0.tgz",
"@auth0/nextjs-auth0": "^4.10.0",
"@langchain/community": "^0.3.57",
"@langchain/core": "^0.3.78",
"@langchain/langgraph": "^0.4.9",
"@langchain/openai": "^0.6.14",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-slot": "^1.2.3",
"@types/pg": "^8.15.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"dotenv": "^17.0.1",
"drizzle-orm": "^0.43.1",
"drizzle-zod": "^0.7.1",
"googleapis": "^148.0.0",
"langchain": "0.3.30",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.44.5",
"drizzle-zod": "^0.8.3",
"googleapis": "^161.0.0",
"langchain": "0.3.35",
"langgraph-nextjs-api-passthrough": "^0.1.4",
"lucide-react": "^0.475.0",
"marked": "^15.0.7",
"nanoid": "^5.1.5",
"next": "15.2.4",
"next-themes": "^0.4.4",
"nuqs": "^2.4.3",
"pdf-parse": "^1.1.1",
"lucide-react": "^0.544.0",
"marked": "^16.3.0",
"nanoid": "^5.1.6",
"next": "15.5.4",
"next-themes": "^0.4.6",
"nuqs": "^2.7.0",
"pdf-parse": "^2.1.1",
"pg": "^8.16.3",
"postgres": "^3.4.5",
"react": "19.0.0",
"postgres": "^3.4.7",
"react": "19.2.0",
"react-device-detect": "^2.2.3",
"react-dom": "19.0.0",
"react-markdown": "^10.0.0",
"react-toastify": "11.0.3",
"sonner": "^1.7.2",
"tailwind-merge": "^2.6.0",
"react-dom": "19.2.0",
"react-markdown": "^10.1.0",
"react-toastify": "11.0.5",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1",
"tailwindcss-animate": "^1.0.7",
"use-stick-to-bottom": "^1.0.44",
"use-stick-to-bottom": "^1.1.1",
"vaul": "^1.1.2",
"zod": "^3.24.2",
"zod-to-json-schema": "^3.23.2"
"zod": "^4.1.11",
"zod-to-json-schema": "^3.24.6"
},
"devDependencies": {
"@next/bundle-analyzer": "^15.1.7",
"@types/node": "^22.13.4",
"@next/bundle-analyzer": "^15.5.4",
"@types/node": "^24.6.2",
"@types/pdf-parse": "^1.1.5",
"@types/react": "19.0.9",
"@types/react-dom": "19.0.3",
"autoprefixer": "^10.4.20",
"drizzle-kit": "^0.31.1",
"eslint": "^9.20.1",
"eslint-config-next": "^15.1.7",
"@types/react": "19.2.0",
"@types/react-dom": "19.2.0",
"autoprefixer": "^10.4.21",
"drizzle-kit": "^0.31.5",
"eslint": "^9.36.0",
"eslint-config-next": "^15.5.4",
"npm-run-all": "^4.1.5",
"postcss": "8.5.2",
"prettier": "^3.4.2",
"postcss": "8.5.6",
"prettier": "^3.6.2",
"tailwindcss": "3.4.17",
"tsx": "^4.19.4",
"typescript": "5.7.3"
"tsx": "^4.20.6",
"typescript": "5.9.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ReactNode } from "react";
*/
export type AuthComponentMode = "redirect" | "popup" | "auto";

export type FederatedConnectionAuthProps = {
export type TokenVaultAuthProps = {
interrupt: {
connection: string;
requiredScopes: string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { BrowserView, MobileView } from "react-device-detect";

import type { TokenVaultAuthProps } from "./TokenVaultAuthProps";
import { TokenVaultConsentPopup } from "./popup";
import { TokenVaultConsentRedirect } from "./redirect";

export function TokenVaultConsent(props: TokenVaultAuthProps) {
const { mode } = props;

switch (mode) {
case "popup":
return <TokenVaultConsentPopup {...props} />;
case "redirect":
return <TokenVaultConsentRedirect {...props} />;
case "auto":
default:
return (
<>
<BrowserView>
<TokenVaultConsentPopup {...props} />
</BrowserView>
<MobileView>
<TokenVaultConsentRedirect {...props} />
</MobileView>
</>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"use client";

import { useCallback, useEffect, useState } from "react";

import { WaitingMessage } from "../util/loader";
import { PromptUserContainer } from "../util/prompt-user-container";
import type { TokenVaultAuthProps } from "./TokenVaultAuthProps";

export function TokenVaultConsentPopup({
interrupt: { connection, requiredScopes, resume },
connectWidget: { icon, title, description, action, containerClassName },
auth: { authorizePath = "/auth/login", returnTo = "/close" } = {},
onFinish,
}: TokenVaultAuthProps) {
const [isLoading, setIsLoading] = useState(false);
const [loginPopup, setLoginPopup] = useState<Window | null>(null);

//Poll for the login process until the popup is closed
// or the user is authorized
useEffect(() => {
if (!loginPopup) {
return;
}
const interval = setInterval(async () => {
if (loginPopup && loginPopup.closed) {
setIsLoading(false);
setLoginPopup(null);
clearInterval(interval);
if (typeof onFinish === "function") {
onFinish();
} else if (typeof resume === "function") {
resume();
}
}
}, 1000);
return () => {
if (interval) {
clearInterval(interval);
}
};
}, [loginPopup, onFinish, resume]);

//Open the login popup
const startLoginPopup = useCallback(async () => {
const search = new URLSearchParams({
returnTo,
connection,
access_type: "offline",
prompt: "consent",
connection_scope: requiredScopes.join(),
});

const url = new URL(authorizePath, window.location.origin);
url.search = search.toString();

const windowFeatures =
"width=800,height=650,status=no,toolbar=no,menubar=no";
const popup = window.open(url.toString(), "_blank", windowFeatures);
if (!popup) {
console.error("Popup blocked by the browser");
return;
} else {
setLoginPopup(popup);
setIsLoading(true);
}
}, [connection, requiredScopes, returnTo, authorizePath]);

if (isLoading) {
return <WaitingMessage />;
}

return (
<PromptUserContainer
title={title}
description={description}
icon={icon}
containerClassName={containerClassName}
action={{
label: action?.label ?? "Connect",
onClick: startLoginPopup,
}}
/>
);
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import { PromptUserContainer } from "../util/prompt-user-container";
import type { FederatedConnectionAuthProps } from "./FederatedConnectionAuthProps";
import type { TokenVaultAuthProps } from "./TokenVaultAuthProps";

export function EnsureAPIAccessRedirect({
export function TokenVaultConsentRedirect({
interrupt: { requiredScopes, connection },
connectWidget: { icon, title, description, action, containerClassName },
auth: {
authorizePath = "/auth/login",
returnTo = window.location.pathname,
} = {},
}: FederatedConnectionAuthProps) {
}: TokenVaultAuthProps) {
return (
<PromptUserContainer
title={title}
Expand Down
85 changes: 43 additions & 42 deletions authenticate-users/vercel-ai-next-js-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,60 @@
"node": ">=18"
},
"dependencies": {
"@ai-sdk/openai": "^1.3.21",
"@auth0/ai-vercel": "^3.1.0",
"@radix-ui/react-avatar": "^1.1.7",
"@radix-ui/react-checkbox": "^1.2.3",
"@radix-ui/react-dialog": "^1.1.11",
"@radix-ui/react-dropdown-menu": "^2.1.12",
"@radix-ui/react-popover": "^1.1.11",
"@radix-ui/react-slot": "^1.2.0",
"ai": "^4.3.13",
"@ai-sdk/openai": "2.0.24",
"@auth0/ai-vercel": "file:../../packages/auth0-ai-vercel-0.0.0.tgz",
"@ai-sdk/react": "2.0.33",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-slot": "^1.2.3",
"ai": "5.0.33",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.43.1",
"drizzle-zod": "^0.7.1",
"googleapis": "^148.0.0",
"drizzle-orm": "^0.44.6",
"drizzle-zod": "^0.8.3",
"googleapis": "^161.0.0",
"llm-chunk": "^0.0.1",
"lucide-react": "^0.475.0",
"marked": "^15.0.7",
"nanoid": "^5.1.5",
"next": "15.2.4",
"next-themes": "^0.4.4",
"nuqs": "^2.4.3",
"pdf-parse": "^1.1.1",
"postgres": "^3.4.5",
"react": "19.0.0",
"lucide-react": "^0.544.0",
"marked": "^16.3.0",
"nanoid": "^5.1.6",
"next": "15.5.4",
"next-themes": "^0.4.6",
"nuqs": "^2.7.0",
"pdf-parse": "^2.1.6",
"postgres": "^3.4.7",
"react": "19.2.0",
"react-device-detect": "^2.2.3",
"react-dom": "19.0.0",
"react-markdown": "^10.0.0",
"react-toastify": "11.0.3",
"sonner": "^1.7.2",
"tailwind-merge": "^2.6.0",
"react-dom": "19.2.0",
"react-markdown": "^10.1.0",
"react-toastify": "11.0.5",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1",
"tailwindcss-animate": "^1.0.7",
"use-stick-to-bottom": "^1.0.44",
"use-stick-to-bottom": "^1.1.1",
"vaul": "^1.1.2",
"zod": "^3.24.2",
"zod-to-json-schema": "^3.23.2"
"zod": "^4.1.11",
"zod-to-json-schema": "^3.24.6"
},
"devDependencies": {
"@next/bundle-analyzer": "^15.1.7",
"@types/node": "^22.13.4",
"@next/bundle-analyzer": "^15.5.4",
"@types/node": "^24.6.2",
"@types/pdf-parse": "^1.1.5",
"@types/react": "19.0.9",
"@types/react-dom": "19.0.3",
"autoprefixer": "^10.4.20",
"dotenv": "^17.0.1",
"drizzle-kit": "^0.31.1",
"eslint": "^9.20.1",
"eslint-config-next": "^15.1.7",
"@types/react": "19.2.0",
"@types/react-dom": "19.2.0",
"autoprefixer": "^10.4.21",
"dotenv": "^17.2.3",
"drizzle-kit": "^0.31.5",
"eslint": "^9.36.0",
"eslint-config-next": "^15.5.4",
"npm-run-all": "^4.1.5",
"postcss": "8.5.2",
"prettier": "^3.4.2",
"postcss": "8.5.6",
"prettier": "^3.6.2",
"tailwindcss": "3.4.17",
"tsx": "^4.19.4",
"typescript": "5.7.3"
"tsx": "^4.20.6",
"typescript": "5.9.3"
}
}
Loading