Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trusted-accounts-sdk-node

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trusted-accounts-sdk-node - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"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;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc