Skip to content

Commit ae97392

Browse files
authored
update readme with flow and theme manage api (#177)
* update readme with flow and theme manage api related descope/etc#2417 * update readme type * fix lint * update readme comments
1 parent ea94e02 commit ae97392

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,35 @@ groupsRes.data.forEach((group) => {
663663
});
664664
```
665665

666+
### Manage Flows
667+
668+
You can import and export flows and screens, or the project theme:
669+
670+
```typescript
671+
// Export the flow and it's matching screens based on the given id
672+
const res = await descopeClient.management.flow.export('sign-up');
673+
console.log('found flow', res.data.flow);
674+
res.data.screens.forEach((screen) => {
675+
// do something
676+
});
677+
678+
// Import the given flow and screens as the given id
679+
const { flow, screens } = res.data;
680+
const updatedRes = descopeClient.management.flow.import('sign-up', flow, screens);
681+
console.log('updated flow', updatedRes.data.flow);
682+
updatedRes.data.screens.forEach((screen) => {
683+
// do something
684+
});
685+
686+
// Export the current theme of the project
687+
const res = descopeClient.management.theme.export();
688+
console.log(res.data.theme);
689+
690+
// Import the given theme to the project
691+
const updatedRes = descopeClient.management.theme.import(theme);
692+
console.log(updatedRes.data.theme);
693+
```
694+
666695
### Manage JWTs
667696

668697
You can add custom claims to a valid JWT.

0 commit comments

Comments
 (0)