@vercel/connect 2.5.0 → 2.5.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 +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,6 +31,21 @@ const token = await getToken(process.env.CONNECTOR_LINEAR!, {
|
|
|
31
31
|
});
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
For a Passport-authenticated user, you can pass the identity returned by
|
|
35
|
+
`requireIdentity` from `@vercel/passport` as the subject:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { getToken } from '@vercel/connect';
|
|
39
|
+
import { requireIdentity } from '@vercel/passport';
|
|
40
|
+
|
|
41
|
+
const identity = await requireIdentity();
|
|
42
|
+
|
|
43
|
+
const token = await getToken('slack/xaa-slack', {
|
|
44
|
+
subject: identity,
|
|
45
|
+
scopes: ['users:read'],
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
34
49
|
To start an authorization request for a user, use `startAuthorization`:
|
|
35
50
|
|
|
36
51
|
```ts
|