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.0.0 to 1.0.1

trusted-accounts-sdk-node.d.ts

5

package.json
{
"name": "trusted-accounts-sdk-node",
"version": "1.0.0",
"version": "1.0.1",
"description": "A simple SDK for Trusted Accounts for NodeJS",
"main": "index.js",
"types": "trusted-accounts-sdk-node.d.ts",
"repository": {

@@ -22,5 +23,5 @@ "type": "git",

"dependencies": {
}
}

42

README.md

@@ -1,1 +0,41 @@

# trusted-accounts-sdk-node
# Trusted Accounts SDK for Node.js
### 1. Start the Validation Flow.
Place this code on your website to show a validation button that starts the validation process. Get your platform credentials by creating a developer account for free in the [**developer console**](https://developers.trustedaccounts.org/).
```
npm install --save trusted-accounts-sdk-node
```
```typescript
import TrustedAccountsClient from 'trusted-accounts-sdk-node';
app.get('/start-verification', async (req, res) => {
const trustedClient = new TrustedAccountsClient(
"CLIENT_ID", // Your Client ID
"REDIRECT_URL" // Your Redirect URI
);
// Generate the verification URL
const verificationUrl = await trustedClient.generateVerificationLink(
'foo@bar.com', // The email of the user you want to validate
);
// Redirect the user to the verification page
// or create a verification button to trigger it manually
res.redirect(verificationUrl);
});
```
### 2. Handle the Callback
After the user completes the verification, they will be redirected back to your redirect URL. Place this code on your website at this url to handle this callback and get the Trusted ID.
```typescript
app.get('/callback', async (req, res) => {
// Get the Trusted ID by passing the code_verifier
const trustedId = await trustedClient.handleCallback(req, code_verifier);
res.send('Verification completed! Trusted ID: ' + trustedId);
});
```
**That's it!** You have successfully integrated Trusted Accounts on your platform! 🖖 Try validate yourself and then go to the user list in the [**developer console**](https://developers.trustedaccounts.org/) to find the newly validated user.
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