@privy-io/react-auth 1.12.1-beta.1 → 1.12.1-beta.3
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/dist/esm/index.js +75 -79
- package/dist/index.d.ts +5 -78
- package/dist/index.js +75 -79
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -191,7 +191,7 @@ interface PrivyProviderProps {
|
|
|
191
191
|
*/
|
|
192
192
|
onSuccess?: (user: User, isNewUser: boolean) => void;
|
|
193
193
|
/**
|
|
194
|
-
* @experimental This feature is
|
|
194
|
+
* @experimental **Experimental**: This feature is {@link https://docs.privy.io/guide/faq/experimental-features subject to change at any time}.
|
|
195
195
|
*
|
|
196
196
|
* An optional callback that will execute if a `login` call fails.
|
|
197
197
|
*
|
|
@@ -429,7 +429,8 @@ interface PrivyInterface {
|
|
|
429
429
|
*/
|
|
430
430
|
setActiveWallet: (address: string) => void;
|
|
431
431
|
/**
|
|
432
|
-
* @experimental
|
|
432
|
+
* @experimental **Experimental**: This feature is {@link https://docs.privy.io/guide/faq/experimental-features subject to change at any time}.
|
|
433
|
+
*
|
|
433
434
|
* Get a short-lived, one-time-use token to start a new Privy session from the existing authenticated session. Raises an exception if the current session was already forked from a previous session.
|
|
434
435
|
*/
|
|
435
436
|
forkSession: () => Promise<string>;
|
|
@@ -454,10 +455,10 @@ interface DefaultsType {
|
|
|
454
455
|
*/
|
|
455
456
|
declare class Http {
|
|
456
457
|
private appId;
|
|
457
|
-
private
|
|
458
|
+
private client;
|
|
458
459
|
private defaults;
|
|
459
460
|
private sdkVersion;
|
|
460
|
-
constructor(appId: string,
|
|
461
|
+
constructor(appId: string, client: PrivyClient, defaults: DefaultsType);
|
|
461
462
|
get<T = any, R = AxiosResponse<T>, D = any>(path: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
462
463
|
post<T = any, R = AxiosResponse<T>, D = any>(path: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
463
464
|
delete<T = any, R = AxiosResponse<T>, D = any>(path: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
|
@@ -526,80 +527,6 @@ interface ValidSessionResponse {
|
|
|
526
527
|
refresh_token: string | null;
|
|
527
528
|
is_new_user?: boolean;
|
|
528
529
|
}
|
|
529
|
-
/**
|
|
530
|
-
* `Session` represents the session lifecycle of the login. It manages token
|
|
531
|
-
* storage, refresh, and deletion.
|
|
532
|
-
*/
|
|
533
|
-
declare class Session {
|
|
534
|
-
private destroyOnce;
|
|
535
|
-
private refreshOnce;
|
|
536
|
-
private authenticateOnce;
|
|
537
|
-
private linkOnce;
|
|
538
|
-
private forkSessionOnce;
|
|
539
|
-
api?: Http;
|
|
540
|
-
constructor();
|
|
541
|
-
get token(): string | null;
|
|
542
|
-
get refreshToken(): string | null;
|
|
543
|
-
/**
|
|
544
|
-
* Checks to see if locally we have refresh credentials. Refresh
|
|
545
|
-
* credentials consist of:
|
|
546
|
-
*
|
|
547
|
-
* 1. Access token
|
|
548
|
-
* 2. Refresh token
|
|
549
|
-
*
|
|
550
|
-
* @returns true if we have what appear to be valid credentials, false otherwise.
|
|
551
|
-
*/
|
|
552
|
-
hasRefreshCredentials(): boolean;
|
|
553
|
-
/**
|
|
554
|
-
* Checks if the session contains a valid token that is not
|
|
555
|
-
* expired or expiring soon.
|
|
556
|
-
*
|
|
557
|
-
* @returns true if token is considered active, false otherwise.
|
|
558
|
-
*/
|
|
559
|
-
hasActiveToken(): boolean;
|
|
560
|
-
/**
|
|
561
|
-
* Checks if the session contains a valid token (correct signature, issuer, and app ID).
|
|
562
|
-
* Accepts an optional clockTolerance for checking the expiration claim on the session's JWT.
|
|
563
|
-
*
|
|
564
|
-
* @returns true if token is valid, false otherwise.
|
|
565
|
-
*/
|
|
566
|
-
hasValidToken(verificationKey: string, appId: string, clockTolerance?: number): Promise<boolean>;
|
|
567
|
-
/**
|
|
568
|
-
* Authenticate the session.
|
|
569
|
-
* @returns Promise<User>
|
|
570
|
-
*/
|
|
571
|
-
authenticate(authFlow: AuthFlow): Promise<{
|
|
572
|
-
user: User | null;
|
|
573
|
-
isNewUser?: boolean;
|
|
574
|
-
}>;
|
|
575
|
-
/**
|
|
576
|
-
* Link's a new account for a user.
|
|
577
|
-
* @returns Promise<User>
|
|
578
|
-
*/
|
|
579
|
-
link(authFlow: AuthFlow): Promise<User | null>;
|
|
580
|
-
/**
|
|
581
|
-
* Renews the auth token using the refresh token.
|
|
582
|
-
* @return Promise<User> if successful with a logged-in user, Promise<null> otherwise.
|
|
583
|
-
*/
|
|
584
|
-
refresh(): Promise<User | null>;
|
|
585
|
-
/**
|
|
586
|
-
* Creates a new session from the current session using the refresh token.
|
|
587
|
-
* @return Promise<string> if successful.
|
|
588
|
-
*/
|
|
589
|
-
forkSession(): Promise<string>;
|
|
590
|
-
/**
|
|
591
|
-
* Destroy the session.
|
|
592
|
-
*/
|
|
593
|
-
destroy(): Promise<void>;
|
|
594
|
-
private _authenticate;
|
|
595
|
-
private _link;
|
|
596
|
-
private _refresh;
|
|
597
|
-
private _destroy;
|
|
598
|
-
private _forkSession;
|
|
599
|
-
private destroyLocalState;
|
|
600
|
-
private storeToken;
|
|
601
|
-
private storeRefreshToken;
|
|
602
|
-
}
|
|
603
530
|
|
|
604
531
|
type AuthMeta = {
|
|
605
532
|
[key: string]: any;
|