
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@touchcode/js-touchcode-sdk
Advanced tools
This implements the touchcode SDK into an js package.
The library is available on npm. It can be installed with: npm install --save @touchcode/js-touchcode-sdk.
import touchcodeInit from "@touchcode/js-touchcode-sdk";
touchcodeInit( campaignId, touchcodeEnabledDiv, progressCallback,decodeCallback, autoRedirect, decodeUrl, testBandwidth)
const decodeCallback = (event) => {
console.log('decode callback', event)
}
<div id=”touchcode_enabled_div” class="touchcode_content"> </div>
.touchcode_content{
display: block;
width: 100%;
height: 100vh;
}
The following example consists of a touchcodeInit module in an index.js file. The campaignID must be provided.
Touchcode calls back to by the decodeCallback with the value decoded in the argument code.
Note: Touchcode receives touch input. It must be the top most element of the view.
JavaScript
import touchcodeInit from "@touchcode/touchcode-sdk";
const decodeCallback = target => console.log(target) // target = https://www.touchcode.com
const progressCallback = touches => console.log(`There are ${touches} touch points`) // use this to give the user progress feedback.
const init = (() => {
let campaignId = 'Provide-Campaign-ID';
let touchcodeEnabledDiv = 'touchcode_enabled_div';
let autoRedirect = false;
let testBandwidth = true;
touchcodeInit(campaignId, touchcodeEnabledDiv, progressCallback, decodeCallback, autoRedirect, testBandwidth);
})()
HTML
<div class=”touchcode_content” id=”touchcode_enabled_div”> </div>
| Name | Type | Default | Description |
|---|---|---|---|
| campaignId | string | REQUIRED | ID of the Touchcode campaign that will be used on this webapp. This value must reflect an already created Touchcode campaign. Only cards in the codeset for this campaign will work on the webapp. |
| touchcodeEnabledDiv | element object | REQUIRED | Element created in step 2. All touches occurring within this element will be sent to the decoder and if applicable, processed for a decode. |
| decodeCallback | func | (code) => null | Called when a decode is triggered with the decoded text passed as an argument. If no callback is specified the page will auto redirect to the target stored in the campaign. |
| progressCallback | func | (code) => null | Called when a touch event is triggered touchpoint data passed as an argument. |
| autoRedirect | bool | true | Boolean variable to determine whether or not the SDK will automatically redirect to the target URL. The absence of this parameter defaults to “True.” |
| decoderUrl | string | null | By default, the Touchcode SDK utilizes a standard decoder. In very rare circumstances, it may be desired to change the decoder that the webapp is using. In nearly all cases, this parameter should not be supplied. |
| testBandwidth | bool | false | Boolean variable to determine whether or not the SDK will automatically preform a bandwidth test during a session. In certain cases this may not be desirable on slow connections and can be disabled by passing “false”. The absence of this parameter defaults to “true.” |
FAQs
The Touchcode Javascript SDK which enables Touchcode experiences.
The npm package @touchcode/js-touchcode-sdk receives a total of 3 weekly downloads. As such, @touchcode/js-touchcode-sdk popularity was classified as not popular.
We found that @touchcode/js-touchcode-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.