Social Verifier
helps user to implement social verify process easily. (Twitter and Github supported).
You can check the list of verified mappings by using our CyberConnect API.
npm install @cyberlab/social-verifier
or
yarn add @cyberlab/social-verifier
Twitter Verifier
uses a 3 step process for linking an Ethereum address to a Twitter account.
- Users use their Ethereum private key to sign a message with their Twitter handle to get a message which contains the generated signature.
- Users post a tweet with this message so others can view.
- Users send a verify request to our server with their wallet address. Our server will recover the signer address from the signature found in the tweet and save the verified inforamtion if the signer address is the same as the address in the request.
Using twitterAuthorize
to get signature message.
import { twitterAuthorize } from "@cyberlab/social-verifier";
const sig = twitterAuthorize(provider, address, handle);
provider
- An ETH provider which should implement one of the following methods: send, sendAsync, request.address
- The Ethereum address that you want to link with your Twitter account.handle
- The handle of your Twitter account.
You can customize your tweet text, but the text should include the signature message from the Signing Data
step.
const text = `Verifying my Web3 identity on @cyberconnecthq: %23LetsCyberConnect %0A ${sig}`;
window.open(`https://twitter.com/intent/tweet?text=${text}`, "_blank");
After posting the tweet, you can call twitterVerify
to link your address with your Twitter account. You can check the verified information by using CyberConnect API.
import { twitterVerify } from "@cyberlab/social-verifier";
try {
await twitterVerify(address, handle, namespace);
console.log("Verify Success!");
} catch (e) {
console.log("Error: ", e.message);
}
address
- The Ethereum address that you want to link with your Twitter account.handle
- The handle of your Twitter account.namespace
- (optional) Your applciation name.
Github Verifier
uses a 3 step process for linking an Ethereum address to a Github account.
- Users use their Ethereum private key to sign a message with their Github username to get a message which contains the generated signature.
- Users create a Github gist with this message.
- Users send a verify request to our server with their wallet address and the gist id. Our server will recover the signer address from the signature found in the gist and save the verified inforamtion if the signer address is the same as the address in the request.
Using githubAuthorize
to get signature message.
import { githubAuthorize } from "@cyberlab/social-verifier";
const sig = githubAuthorize(provider, address, username);
provider
- An ETH provider which should implement one of the following methods: send, sendAsync, request.address
- The Ethereum address that you want to link with your Github account.username
- The username of your Github account.
You need to create a gist in your Github. You can customize your gist text, but the text should include the signature message from the Signing Data
step
After posting the gist, you can call githubVerify
to link your address with your Github account. You can check the verified information by using CyberConnect API.
import { githubVerify } from "@cyberlab/social-verifier";
try {
await githubVerify(address, gistId, namespace);
console.log("Verify Success!");
} catch (e) {
console.log("Error: ", e.message);
}
address
- The Ethereum address that you want to link with your Github account.gistId
- The id of your Github gist. It's the last part of your gist url.namespace
- (optional) Your applciation name.
We are happy to accept any contributions, feel free to make a suggestion or submit a pull request.