@lynq/google 0.1.0 → 0.1.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 +66 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @lynq/google
|
|
2
|
+
|
|
3
|
+
Google OAuth provider for [lynq](https://www.npmjs.com/package/@lynq/lynq) MCP framework.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @lynq/google @lynq/lynq
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createMCPServer } from "@lynq/lynq";
|
|
15
|
+
import { google } from "@lynq/google";
|
|
16
|
+
|
|
17
|
+
const server = createMCPServer({ name: "my-server", version: "1.0.0" });
|
|
18
|
+
|
|
19
|
+
server.tool("private-data", google({
|
|
20
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
21
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
22
|
+
redirectUri: "http://localhost:3000/lynq/auth/google/callback",
|
|
23
|
+
}), {
|
|
24
|
+
description: "Access private data",
|
|
25
|
+
}, async (args, c) => {
|
|
26
|
+
const user = c.session.get("user");
|
|
27
|
+
return c.text(`Hello, ${user.name}`);
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### With Hono adapter
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { mountLynq } from "@lynq/hono";
|
|
35
|
+
|
|
36
|
+
mountLynq(app, server, {
|
|
37
|
+
pages: {
|
|
38
|
+
google: {
|
|
39
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
40
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Options
|
|
47
|
+
|
|
48
|
+
| Option | Type | Default | Description |
|
|
49
|
+
|---|---|---|---|
|
|
50
|
+
| `clientId` | `string` | required | Google OAuth client ID |
|
|
51
|
+
| `clientSecret` | `string` | required | Google OAuth client secret |
|
|
52
|
+
| `redirectUri` | `string` | required | OAuth callback URL |
|
|
53
|
+
| `scopes` | `string[]` | `["openid", "profile", "email"]` | Google OAuth scopes |
|
|
54
|
+
| `sessionKey` | `string` | `"user"` | Session key to store user data |
|
|
55
|
+
| `message` | `string` | `"Please sign in with Google to continue."` | Elicitation message |
|
|
56
|
+
| `timeout` | `number` | `300000` | Elicitation timeout (ms) |
|
|
57
|
+
| `skipIf` | `(c) => boolean` | — | Skip middleware conditionally |
|
|
58
|
+
| `onComplete` | `(c) => void` | — | Run after successful auth |
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
[https://hogekai.github.io/lynq/](https://hogekai.github.io/lynq/)
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynq/google",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Google OAuth provider for lynq MCP framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lynq/lynq": "^0.8.
|
|
17
|
+
"@lynq/lynq": "^0.8.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsup": "^8.0.0",
|