@agentic-passport/next 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +21 -4
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @agentic-passport/next
|
|
2
|
+
|
|
3
|
+
Vendor-side AgentPassport SDK for Next.js (14, 15, 16). Sidecar handler — composes with Clerk middleware, does not replace it.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @agentic-passport/next
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
`lib/agent-gate.ts`:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { agentPassport } from '@agentic-passport/next';
|
|
17
|
+
import { clerkAgentProvisioner } from '@agentic-passport/next/clerk';
|
|
18
|
+
import { clerkClient } from '@clerk/nextjs/server';
|
|
19
|
+
|
|
20
|
+
export const getGate = agentPassport({
|
|
21
|
+
vendorOrigin: 'https://your-vendor.example',
|
|
22
|
+
vendorName: 'your-app',
|
|
23
|
+
trustedIssuers: ['https://issuer.agentpassport.app'],
|
|
24
|
+
scopes: ['your.scope'],
|
|
25
|
+
hooks: clerkAgentProvisioner({ clerkClient, vendorOrigin: 'https://your-vendor.example' }),
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`app/agent/[...agentpassport]/route.ts` and `app/.well-known/agent-passport/[[...rest]]/route.ts`:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { handleAgentPassport } from '@agentic-passport/next';
|
|
33
|
+
import { getGate } from '@/lib/agent-gate';
|
|
34
|
+
export const runtime = 'nodejs';
|
|
35
|
+
export const dynamic = 'force-dynamic';
|
|
36
|
+
export const GET = (req: Request) => handleAgentPassport(req, getGate);
|
|
37
|
+
export const POST = (req: Request) => handleAgentPassport(req, getGate);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Subpath exports
|
|
41
|
+
|
|
42
|
+
- `@agentic-passport/next` — Node-runtime handler + types
|
|
43
|
+
- `@agentic-passport/next/edge` — `isAgentRequest()` for Edge middleware (no `node:crypto`)
|
|
44
|
+
- `@agentic-passport/next/clerk` — Clerk adapter (`clerkAgentProvisioner`, `agentIdentity`)
|
|
45
|
+
|
|
46
|
+
## Spec
|
|
47
|
+
|
|
48
|
+
[Wire format spec](https://github.com/mkotsollaris/agentpassport/blob/main/packages/protocol/spec.md). [Repo README](https://github.com/mkotsollaris/agentpassport#readme) has the full integration guide.
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
Apache-2.0. [Repository](https://github.com/mkotsollaris/agentpassport)
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export * from './types.js';
|
|
|
2
2
|
export * from './handler.js';
|
|
3
3
|
export * from './next-adapter.js';
|
|
4
4
|
export * from './stores.js';
|
|
5
|
-
export declare const VENDOR_SDK_NEXT_VERSION = "0.3.
|
|
5
|
+
export declare const VENDOR_SDK_NEXT_VERSION = "0.3.1";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -6,5 +6,5 @@ export * from './stores.js';
|
|
|
6
6
|
// NOTE: for Edge runtime (middleware), use the subpath import:
|
|
7
7
|
// import { isAgentRequest } from '@agentic-passport/next/edge';
|
|
8
8
|
// That path never pulls in node:crypto.
|
|
9
|
-
export const VENDOR_SDK_NEXT_VERSION = '0.3.
|
|
9
|
+
export const VENDOR_SDK_NEXT_VERSION = '0.3.1';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-passport/next",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "AgentPassport adapter for Next.js — vendor-side sidecar handler.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"jose": "^6.2.3",
|
|
47
|
-
"@agentic-passport/protocol": "0.3.
|
|
48
|
-
"@agentic-passport/core": "0.3.
|
|
47
|
+
"@agentic-passport/protocol": "0.3.1",
|
|
48
|
+
"@agentic-passport/core": "0.3.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"next": "^16.2.6",
|
|
@@ -53,6 +53,23 @@
|
|
|
53
53
|
"typescript": "^5.7.3",
|
|
54
54
|
"vitest": "^4.1.6"
|
|
55
55
|
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/mkotsollaris/agentpassport.git",
|
|
59
|
+
"directory": "packages/vendor-sdk-next"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/mkotsollaris/agentpassport/tree/main/packages/vendor-sdk-next#readme",
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/mkotsollaris/agentpassport/issues"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"agent-passport",
|
|
67
|
+
"agentic-ai",
|
|
68
|
+
"ai-agents",
|
|
69
|
+
"authentication",
|
|
70
|
+
"rfc-9421",
|
|
71
|
+
"dpop"
|
|
72
|
+
],
|
|
56
73
|
"scripts": {
|
|
57
74
|
"build": "tsc -p tsconfig.json",
|
|
58
75
|
"test": "vitest run",
|