@instantdb/core
Version:
Instant's core local abstraction
45 lines • 1.81 kB
TypeScript
import { User } from './clientTypes.ts';
type SharedInput = {
apiURI: string;
appId: string;
};
export type SendMagicCodeParams = {
email: string;
};
export type SendMagicCodeResponse = {
sent: true;
};
export declare function sendMagicCode({ apiURI, appId, email, }: SharedInput & SendMagicCodeParams): Promise<SendMagicCodeResponse>;
export type VerifyMagicCodeParams = {
email: string;
code: string;
refreshToken?: string | undefined;
};
export type VerifyResponse = {
user: User;
};
export declare function verifyMagicCode({ apiURI, appId, email, code, refreshToken, }: SharedInput & VerifyMagicCodeParams): Promise<VerifyResponse>;
export type VerifyRefreshTokenParams = {
refreshToken: string;
};
export declare function verifyRefreshToken({ apiURI, appId, refreshToken, }: SharedInput & VerifyRefreshTokenParams): Promise<VerifyResponse>;
export declare function signInAsGuest({ apiURI, appId, }: SharedInput): Promise<VerifyResponse>;
export type ExchangeCodeForTokenParams = {
code: string;
codeVerifier?: string;
refreshToken?: string | undefined;
};
export declare function exchangeCodeForToken({ apiURI, appId, code, codeVerifier, refreshToken, }: SharedInput & ExchangeCodeForTokenParams): Promise<VerifyResponse>;
export type SignInWithIdTokenParams = {
nonce?: string | null | undefined;
idToken: string;
clientName: string;
refreshToken?: string;
};
export declare function signInWithIdToken({ apiURI, appId, nonce, idToken, clientName, refreshToken, }: SharedInput & SignInWithIdTokenParams): Promise<VerifyResponse>;
export type SignoutParams = {
refreshToken: string;
};
export declare function signOut({ apiURI, appId, refreshToken, }: SharedInput & SignoutParams): Promise<{}>;
export {};
//# sourceMappingURL=authAPI.d.ts.map