trusted-accounts-sdk-node
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "trusted-accounts-sdk-node", | ||
"type": "module", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A simple SDK for Trusted Accounts for NodeJS", | ||
@@ -6,0 +6,0 @@ "main": "src/index.js", |
@@ -1,30 +0,42 @@ | ||
// src/index.d.ts | ||
declare module 'trusted-accounts-sdk-node' { | ||
export default class TrustedAccountsClient { | ||
constructor(clientId: string, clientSecret: string, redirectUrl: string); | ||
interface TrustedAccountsSDKOptions { | ||
clientId: string; | ||
clientSecret: string; | ||
redirectUri: string; | ||
sessionStorage?: (req: any) => any; | ||
} | ||
/** | ||
* Generates a verification link for a user. | ||
* @param email - The email of the user you want to validate. | ||
* @param state - Optional state parameter for maintaining the session. | ||
* @returns A promise that resolves to the verification link. | ||
*/ | ||
generateVerificationLink(email: string, state?: string): Promise<string>; | ||
interface GenerateVerificationLinkOptions { | ||
email: string; | ||
state?: string | null; | ||
} | ||
/** | ||
* Handles the callback after verification. | ||
* @param url - The callback URL to process. | ||
* @returns An object containing the trusted ID and optional state. | ||
*/ | ||
handleCallback(url: string): { trustedId: string; state?: string }; | ||
interface CallbackResponse { | ||
trustedId: string; | ||
state?: any; | ||
[key: string]: any; | ||
} | ||
/** | ||
* Retrieves information about a trusted user. | ||
* @param trustedId - The ID of the trusted user. | ||
* @returns A promise that resolves to the user data. | ||
*/ | ||
getUser(trustedId: string): Promise<any>; | ||
interface UserInfo { | ||
trustedId: string; | ||
email: string; | ||
verified: boolean; | ||
[key: string]: any; | ||
} | ||
class TrustedAccountsSDK { | ||
constructor(options: TrustedAccountsSDKOptions); | ||
// Generates a verification link for user validation | ||
generateVerificationLink(email: string, state?: string | null): Promise<string>; | ||
// Handles the callback URL after verification | ||
handleCallback(url: string): Promise<CallbackResponse>; | ||
// Retrieves user information using the Trusted ID | ||
getUser(trustedId: string): Promise<UserInfo>; | ||
} | ||
export default TrustedAccountsSDK; | ||
} | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13214
284