@nuwa-ai/identity-kit-web
Version:
Web extensions for Nuwa Identity Kit
45 lines (44 loc) • 1.17 kB
TypeScript
import type { VerificationRelationship } from '@nuwa-ai/identity-kit';
import { KeyManager, KeyTypeInput } from '@nuwa-ai/identity-kit';
export interface ConnectOptions {
cadopDomain?: string;
keyType?: KeyTypeInput;
idFragment?: string;
relationships?: VerificationRelationship[];
redirectPath?: string;
agentDid?: string;
}
export interface AuthResult {
success: boolean;
agentDid?: string;
keyId?: string;
error?: string;
}
/**
* Manages deep link authentication flow
*/
export declare class DeepLinkManager {
private keyManager;
private sessionStorage;
constructor(options?: {
keyManager?: KeyManager;
sessionStorage?: Storage;
});
/**
* Build a deep link URL for adding a key to a DID
*/
buildAddKeyUrl(opts?: ConnectOptions): Promise<{
url: string;
state: string;
privateKeyMultibase: string;
publicKeyMultibase: string;
}>;
/**
* Handle the callback from the deep link
*/
handleCallback(search: string): Promise<AuthResult>;
/**
* Generate a random state string
*/
private generateRandomState;
}