
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
tokenchannel
Advanced tools
This is the official Javascript/Typescript Library for TokenChannel.io.
Remember that in order to start using TokenChannel.io API, you will need to register an account at https://tokenchannel.io and get an API KEY.
npm install tokenchannel
const apiKey = 'TCk-EjyljGEI032PiREvOJiN9g9RjPYUDWZWxhXE';
const client = new Tokenchannel(apiKey); // new Tokenchannel(apiKey, true) whether test mode is enabled for every challenge
try {
const channel = Channel.SMS;
const identifier = '+14155552671'; // E164
const {requestId} = await client.challenge(channel, identifier);
console.log("RequestId: ", requestId);
} catch (error) {
if (error instanceof TargetOptOutError) {
// handleCustomerOptOut()
} else if(error instanceof InvalidIdentifierError) {
// handleInvalidIdentifier()
} else if(error instanceof OutOfBalanceError) {
// handleOutOfBalanceError()
} else {
// handleError()
}
}
let authCode = '123456';
try {
const {channel, identifier} = await client.authenticate(requestId, authCode);
console.log(`Challenge successfully passed: ${identifier} in ${channel}`);
} catch (error) {
if (error instanceof InvalidCodeError || error instanceof BadRequestError) {
console.log("Invalid code");
} else if (error instanceof ChallengeExpiredError || error instanceof ChallengeClosedError
|| error instanceof ChallengeNotFoundError || error instanceof MaxAttemptsExceededError) {
console.log("Create a new challenge");
} else {
// Handle Unexpected
console.log("Error: ", error.message);
}
}
node dist/example/example.js challenge PUSHOVER <userId>
FAQs
README.md
The npm package tokenchannel receives a total of 0 weekly downloads. As such, tokenchannel popularity was classified as not popular.
We found that tokenchannel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.