Skip to content

Commit cffafa3

Browse files
igneel64SokratisVidros
authored andcommitted
fix(backend-core): Add type explanation on organization CreateParams
chore(sdk-node): Add organizations test example
1 parent 63d37e6 commit cffafa3

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎packages/backend-core/src/api/endpoints/OrganizationApi.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type GetOrganizationListParams = {
1818
type CreateParams = {
1919
name: string;
2020
slug?: string;
21+
/* The User id for the user creating the organization. The user will become an administrator for the organization. */
2122
createdBy: string;
2223
} & OrganizationMetadataParams;
2324

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { organizations, users } from '@clerk/clerk-sdk-node';
2+
3+
console.log('Get user to create organization');
4+
const [creator] = await users.getUserList();
5+
6+
console.log('Create organization');
7+
const organization = await organizations.createOrganization({
8+
name: 'test-organization',
9+
createdBy: creator.id,
10+
});
11+
console.log(organization);
12+
13+
console.log('Update organization metadata');
14+
const updatedOrganizationMetadata =
15+
await organizations.updateOrganizationMetadata(organization.id, {
16+
publicMetadata: { test: 1 },
17+
});
18+
console.log(updatedOrganizationMetadata);

0 commit comments

Comments
 (0)