@@ -39,6 +39,10 @@ export type SignOutOptions = {
39
39
* multi-session applications.
40
40
*/
41
41
sessionId ?: string ;
42
+ /**
43
+ * Specify a redirect URL to navigate after sign out is complete.
44
+ */
45
+ redirectUrl ?: string ;
42
46
} ;
43
47
44
48
export interface SignOut {
@@ -341,15 +345,20 @@ export interface Clerk {
341
345
buildOrganizationProfileUrl ( ) : string ;
342
346
343
347
/**
344
- * Returns the configured afterSignIn url of the instance.
348
+ * Returns the configured afterSignInUrl of the instance.
345
349
*/
346
350
buildAfterSignInUrl ( ) : string ;
347
351
348
352
/**
349
- * Returns the configured afterSignIn url of the instance.
353
+ * Returns the configured afterSignInUrl of the instance.
350
354
*/
351
355
buildAfterSignUpUrl ( ) : string ;
352
356
357
+ /**
358
+ * Returns the configured afterSignOutUrl of the instance.
359
+ */
360
+ buildAfterSignOutUrl ( ) : string ;
361
+
353
362
/**
354
363
*
355
364
* Redirects to the provided url after decorating it with the auth token for development instances.
@@ -397,6 +406,11 @@ export interface Clerk {
397
406
*/
398
407
redirectToAfterSignUp : ( ) => void ;
399
408
409
+ /**
410
+ * Redirects to the configured afterSignOut URL.
411
+ */
412
+ redirectToAfterSignOut : ( ) => void ;
413
+
400
414
/**
401
415
* Completes an OAuth or SAML redirection flow started by
402
416
* {@link Clerk.client.signIn.authenticateWithRedirect} or {@link Clerk.client.signUp.authenticateWithRedirect}
@@ -435,17 +449,7 @@ export interface Clerk {
435
449
handleUnauthenticated : ( ) => Promise < unknown > ;
436
450
}
437
451
438
- export type HandleOAuthCallbackParams = {
439
- /**
440
- * Full URL or path to navigate after successful sign up.
441
- */
442
- afterSignUpUrl ?: string | null ;
443
-
444
- /**
445
- * Full URL or path to navigate after successful sign in.
446
- */
447
- afterSignInUrl ?: string | null ;
448
-
452
+ export type HandleOAuthCallbackParams = AfterActionURLs & {
449
453
/**
450
454
* Full URL or path to navigate after successful sign in
451
455
* or sign up.
@@ -513,35 +517,34 @@ type ClerkOptionsNavigation = ClerkOptionsNavigationFn & {
513
517
routerDebug ?: boolean ;
514
518
} ;
515
519
516
- export type ClerkOptions = ClerkOptionsNavigation & {
517
- appearance ?: Appearance ;
518
- localization ?: LocalizationResource ;
519
- polling ?: boolean ;
520
- selectInitialSession ?: ( client : ClientResource ) => ActiveSessionResource | null ;
521
- /** Controls if ClerkJS will load with the standard browser setup using Clerk cookies */
522
- standardBrowser ?: boolean ;
523
- /** Optional support email for display in authentication screens */
524
- supportEmail ?: string ;
525
- touchSession ?: boolean ;
526
- signInUrl ?: string ;
527
- signUpUrl ?: string ;
528
- afterSignInUrl ?: string ;
529
- afterSignUpUrl ?: string ;
530
- allowedRedirectOrigins ?: Array < string | RegExp > ;
531
- isSatellite ?: boolean | ( ( url : URL ) => boolean ) ;
532
-
533
- /**
534
- * Telemetry options
535
- */
536
- telemetry ?:
537
- | false
538
- | {
539
- disabled ?: boolean ;
540
- debug ?: boolean ;
541
- } ;
520
+ export type ClerkOptions = ClerkOptionsNavigation &
521
+ AfterActionURLs & {
522
+ appearance ?: Appearance ;
523
+ localization ?: LocalizationResource ;
524
+ polling ?: boolean ;
525
+ selectInitialSession ?: ( client : ClientResource ) => ActiveSessionResource | null ;
526
+ /** Controls if ClerkJS will load with the standard browser setup using Clerk cookies */
527
+ standardBrowser ?: boolean ;
528
+ /** Optional support email for display in authentication screens */
529
+ supportEmail ?: string ;
530
+ touchSession ?: boolean ;
531
+ signInUrl ?: string ;
532
+ signUpUrl ?: string ;
533
+ allowedRedirectOrigins ?: Array < string | RegExp > ;
534
+ isSatellite ?: boolean | ( ( url : URL ) => boolean ) ;
542
535
543
- sdkMetadata ?: SDKMetadata ;
544
- } ;
536
+ /**
537
+ * Telemetry options
538
+ */
539
+ telemetry ?:
540
+ | false
541
+ | {
542
+ disabled ?: boolean ;
543
+ debug ?: boolean ;
544
+ } ;
545
+
546
+ sdkMetadata ?: SDKMetadata ;
547
+ } ;
545
548
546
549
export interface NavigateOptions {
547
550
replace ?: boolean ;
@@ -572,7 +575,7 @@ export type SignUpInitialValues = {
572
575
username ?: string ;
573
576
} ;
574
577
575
- export type RedirectOptions = {
578
+ type AfterActionURLs = {
576
579
/**
577
580
* Full URL or path to navigate after successful sign in.
578
581
*/
@@ -584,6 +587,13 @@ export type RedirectOptions = {
584
587
*/
585
588
afterSignUpUrl ?: string | null ;
586
589
590
+ /**
591
+ * Full URL or path to navigate after successful sign out.
592
+ */
593
+ afterSignOutUrl ?: string | null ;
594
+ } ;
595
+
596
+ export type RedirectOptions = AfterActionURLs & {
587
597
/**
588
598
* Full URL or path to navigate after successful sign in,
589
599
* or sign up.
0 commit comments