forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvitations.ts
More file actions
27 lines (23 loc) · 727 Bytes
/
Copy pathinvitations.ts
File metadata and controls
27 lines (23 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Usage:
// From examples/node, run files with "npm test ./src/invitations.ts"
import { invitations } from '@clerk/clerk-sdk-node';
// Create an invitation
await invitations.createInvitation({
emailAddress: 'test@example.com',
publicMetadata: {
some_metadata: 'test',
some_nested: {
some_metadata: 'test',
},
},
});
// Create another invitation
const { id } = await invitations.createInvitation({
emailAddress: 'will-be-revoked@example.com',
});
// Get invitation list
const invitationList = await invitations.getInvitationList();
console.log(invitationList);
// Revoke the last invitation
const revokedInvitation = await invitations.revokeInvitation(String(id));
console.log(revokedInvitation);